Hoppa till innehållet

Returer

Customer returns (RMA): register a return against a sales order, approve it and receive the goods back into stock. Addressed by returnNumber.

6 anrop GET POST Bas-URL https://api.erp.fluit.cloud/preview

Autentisering, felkoder, rate limits, idempotens och paginering gäller alla anrop och står samlade under Kom igång.

GET /returns

List customer returns

Returns a paginated list of customer returns, sorted by returnNumber. ?modifiedSince= returns both created and modified returns, so it can be used for delta sync; deletions are reported by GET /preview/deletions.

Frågeparametrar

Fält Typ Beskrivning
search string Matches return number and RMA number, case-insensitively and on partial words.
status enum Filters on how far the return has been processed. Draft Approved Received CreditNoted Closed Cancelled
orderNumber string Returns only the returns raised against this sales order number.
customerNumber string Returns only the returns from this customer number.
modifiedSince string(date-time) Returns only records created or changed at or after this instant (ISO 8601 UTC datetime). A change anywhere inside the record counts, including on its lines.
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicReturnResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the return was created.
currencyCode string · nullable ISO 4217 currency code the return is valued in.
customerNumber string · nullable Customer number the return belongs to. Null if the customer has no number.
externalNotes string · nullable Notes visible to the customer. Null if not set.
lines ReturnLine[] · nullable The return's lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp when the return was last modified. Null if never modified.
orderNumber string · nullable Order number the goods were returned from.
reason string · nullable Why the goods came back: Defective, WrongItem, DamagedInTransit, CustomerRemorse, Warranty, QualityIssue, OverDelivery or Other.
receivedDate string(date) · nullable Date the goods arrived back (ISO 8601 date). Null until received.
returnDate string(date) Date the return was registered (ISO 8601 date).
returnNumber string · nullable Unique return number.
rmaNumber string · nullable The customer's own RMA reference. Null if not set.
status enum Status of a customer return. Draft Approved Received CreditNoted Closed Cancelled
totalAmount decimal Net total of the returned lines. Serialised as a decimal string.
totalVat decimal Total VAT on the returned lines. Serialised as a decimal string.
warehouseCode string · nullable Warehouse the goods are returned to.
400 ProblemDetails ?status= got a value outside its list.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/returns" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "createdDate": "2026-06-11T09:24:13.418",
      "currencyCode": "SEK",
      "customerNumber": "CUST-001",
      "externalNotes": "string",
      "lines": [
        {
          "condition": "string",
          "itemName": "Widget A",
          "itemNumber": "WIDGET-A",
          "lineNumber": 1,
          "lineTotal": "299.00",
          "notes": "string",
          "orderLineNumber": 42,
          "quantity": "10",
          "unitPrice": "299.00"
        }
      ],
      "links": {
        "self": "string"
      },
      "modifiedDate": "2026-06-11T09:24:13.418",
      "orderNumber": "SO-2026-1041",
      "reason": "string",
      "receivedDate": "2026-06-11",
      "returnDate": "2026-06-11",
      "returnNumber": "RMA-2026-0037",
      "rmaNumber": "ABC-001",
      "status": "Draft",
      "totalAmount": "299.00",
      "totalVat": "299.00",
      "warehouseCode": "MAIN"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /returns

Create a customer return

Registers a return against a sales order in Draft status and returns it in the same shape as GET /preview/returns/{returnNumber}. Omit lines to return the whole order — every delivered line is added at its delivered quantity, which is the common case for a webshop return.

Visa hela beskrivningen

Pass lines to return specific quantities. The return and its lines are created in one transaction — if any line fails, nothing is created. Registering a return does not move stock: approve it, then receive it with POST /preview/returns/{returnNumber}/receive. Known error codes: SalesOrder.NotFound, SalesOrderLine.NotFound, SalesReturn.QuantityExceedsDelivered, SalesReturn.NoDeliveredLines.

Body krävs

Fält Typ Beskrivning
externalNotes string · nullable Notes visible to the customer.
internalNotes string · nullable Notes visible only internally.
lines CreateReturnLine[] · nullable Lines to return. Omit to return the whole order — every delivered line is added at its delivered quantity.
orderNumber Krävs string Sales order the goods are returned from.
reason Krävs enum Defective WrongItem DamagedInTransit CustomerRemorse Warranty QualityIssue OverDelivery Other
returnDate string(date) · nullable Date the return was registered. Defaults to today.
rmaNumber string · nullable The customer's own RMA reference.
warehouseCode string · nullable Warehouse to receive the goods into. Defaults to the order's warehouse.

Svar

201 PublicReturnResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the return was created.
currencyCode string · nullable ISO 4217 currency code the return is valued in.
customerNumber string · nullable Customer number the return belongs to. Null if the customer has no number.
externalNotes string · nullable Notes visible to the customer. Null if not set.
lines ReturnLine[] · nullable The return's lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp when the return was last modified. Null if never modified.
orderNumber string · nullable Order number the goods were returned from.
reason string · nullable Why the goods came back: Defective, WrongItem, DamagedInTransit, CustomerRemorse, Warranty, QualityIssue, OverDelivery or Other.
receivedDate string(date) · nullable Date the goods arrived back (ISO 8601 date). Null until received.
returnDate string(date) Date the return was registered (ISO 8601 date).
returnNumber string · nullable Unique return number.
rmaNumber string · nullable The customer's own RMA reference. Null if not set.
status enum Status of a customer return. Draft Approved Received CreditNoted Closed Cancelled
totalAmount decimal Net total of the returned lines. Serialised as a decimal string.
totalVat decimal Total VAT on the returned lines. Serialised as a decimal string.
warehouseCode string · nullable Warehouse the goods are returned to.
400 ProblemDetails The sales order, one of its line numbers or the warehouse code does not exist, a line returns more than was delivered, or the order has no delivered lines to return.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 409 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/returns" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Return two units of one line as damaged
{
  "externalNotes": "Outer carton crushed on arrival.",
  "lines": [
    {
      "condition": "Damaged",
      "notes": "Both units dented",
      "orderLineNumber": 1,
      "quantity": "2"
    }
  ],
  "orderNumber": "SO-2026-00042",
  "reason": "DamagedInTransit",
  "rmaNumber": "RMA-9912",
  "warehouseCode": "HUVUD"
}
Return the whole order
{
  "orderNumber": "SO-2026-00042",
  "reason": "CustomerRemorse"
}
Svar 201
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "customerNumber": "CUST-001",
  "externalNotes": "string",
  "lines": [
    {
      "condition": "string",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "orderLineNumber": 42,
      "quantity": "10",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderNumber": "SO-2026-1041",
  "reason": "string",
  "receivedDate": "2026-06-11",
  "returnDate": "2026-06-11",
  "returnNumber": "RMA-2026-0037",
  "rmaNumber": "ABC-001",
  "status": "Draft",
  "totalAmount": "299.00",
  "totalVat": "299.00",
  "warehouseCode": "MAIN"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /returns/{returnNumber}

Get a customer return by return number

Returns a customer return with its lines. Each line points back to the sales order line it came from and carries the condition the goods arrived in. Responses carry a weak ETag; pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.

returns:read Stödjer ETag

Sökvägsparametrar

Fält Typ Beskrivning
returnNumber Krävs string Return number of the customer return to read.

Svar

200 PublicReturnResponse
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the return was created.
currencyCode string · nullable ISO 4217 currency code the return is valued in.
customerNumber string · nullable Customer number the return belongs to. Null if the customer has no number.
externalNotes string · nullable Notes visible to the customer. Null if not set.
lines ReturnLine[] · nullable The return's lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp when the return was last modified. Null if never modified.
orderNumber string · nullable Order number the goods were returned from.
reason string · nullable Why the goods came back: Defective, WrongItem, DamagedInTransit, CustomerRemorse, Warranty, QualityIssue, OverDelivery or Other.
receivedDate string(date) · nullable Date the goods arrived back (ISO 8601 date). Null until received.
returnDate string(date) Date the return was registered (ISO 8601 date).
returnNumber string · nullable Unique return number.
rmaNumber string · nullable The customer's own RMA reference. Null if not set.
status enum Status of a customer return. Draft Approved Received CreditNoted Closed Cancelled
totalAmount decimal Net total of the returned lines. Serialised as a decimal string.
totalVat decimal Total VAT on the returned lines. Serialised as a decimal string.
warehouseCode string · nullable Warehouse the goods are returned to.
304 Tom body.
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
404 ProblemDetails No return with that return number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/returns/{returnNumber}" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "customerNumber": "CUST-001",
  "externalNotes": "string",
  "lines": [
    {
      "condition": "string",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "orderLineNumber": 42,
      "quantity": "10",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderNumber": "SO-2026-1041",
  "reason": "string",
  "receivedDate": "2026-06-11",
  "returnDate": "2026-06-11",
  "returnNumber": "RMA-2026-0037",
  "rmaNumber": "ABC-001",
  "status": "Draft",
  "totalAmount": "299.00",
  "totalVat": "299.00",
  "warehouseCode": "MAIN"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /returns/{returnNumber}/approve

Approve a customer return

Moves the return from Draft to Approved, which is the point at which the customer can be told to send the goods back. Returns the return so a storefront can show the approved state without a second request. No stock moves here — that happens on receipt.

Sökvägsparametrar

Fält Typ Beskrivning
returnNumber Krävs string Return number of the return to approve.

Svar

200 PublicReturnResponse
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the return was created.
currencyCode string · nullable ISO 4217 currency code the return is valued in.
customerNumber string · nullable Customer number the return belongs to. Null if the customer has no number.
externalNotes string · nullable Notes visible to the customer. Null if not set.
lines ReturnLine[] · nullable The return's lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp when the return was last modified. Null if never modified.
orderNumber string · nullable Order number the goods were returned from.
reason string · nullable Why the goods came back: Defective, WrongItem, DamagedInTransit, CustomerRemorse, Warranty, QualityIssue, OverDelivery or Other.
receivedDate string(date) · nullable Date the goods arrived back (ISO 8601 date). Null until received.
returnDate string(date) Date the return was registered (ISO 8601 date).
returnNumber string · nullable Unique return number.
rmaNumber string · nullable The customer's own RMA reference. Null if not set.
status enum Status of a customer return. Draft Approved Received CreditNoted Closed Cancelled
totalAmount decimal Net total of the returned lines. Serialised as a decimal string.
totalVat decimal Total VAT on the returned lines. Serialised as a decimal string.
warehouseCode string · nullable Warehouse the goods are returned to.
400 ProblemDetails The return has no lines to approve.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No return with that return number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The return is not in Draft.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/returns/{returnNumber}/approve" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)"
Svar 200
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "customerNumber": "CUST-001",
  "externalNotes": "string",
  "lines": [
    {
      "condition": "string",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "orderLineNumber": 42,
      "quantity": "10",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderNumber": "SO-2026-1041",
  "reason": "string",
  "receivedDate": "2026-06-11",
  "returnDate": "2026-06-11",
  "returnNumber": "RMA-2026-0037",
  "rmaNumber": "ABC-001",
  "status": "Draft",
  "totalAmount": "299.00",
  "totalVat": "299.00",
  "warehouseCode": "MAIN"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /returns/{returnNumber}/lines

List return lines

Returns the lines on a return, sorted by line number ascending. The same lines are also embedded in GET /preview/returns/{returnNumber}; this endpoint exists so that a return with many lines can be paged through rather than arriving as one unbounded array.

returns:read Paginerad

Sökvägsparametrar

Fält Typ Beskrivning
returnNumber Krävs string Return number of the return whose lines to list.

Frågeparametrar

Fält Typ Beskrivning
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Svar

200 PagedResult_PublicReturnLineResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
condition string · nullable Condition the goods came back in.
itemName string · nullable Display name of the item.
itemNumber string · nullable Item number being returned.
lineNumber integer Line number, unique within the return.
lineTotal decimal Line total excluding VAT. Serialised as a decimal string.
notes string · nullable Free-text notes on the line. Null if not set.
orderLineNumber integer Line number on the originating sales order.
quantity decimal Quantity returned. Serialised as a decimal string.
unitPrice decimal Unit price credited. Serialised as a decimal string.
404 ProblemDetails No return with that return number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/preview/returns/{returnNumber}/lines" \
  -H "X-Api-Key: fluit_live_sk_..."
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "condition": "string",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "orderLineNumber": 42,
      "quantity": "10",
      "unitPrice": "299.00"
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

POST /returns/{returnNumber}/receive

Receive a customer return

Books the returned goods back into the return's warehouse and moves the return to Received. Only lines in Resellable condition go back into available stock; damaged defective and for-disposal lines are booked but not made available.

Visa hela beskrivningen

Returns the return so the caller can see the received state without a second request. The resulting movements are readable from GET /preview/inventory/transactions with ?transactionType=Return. Receiving does not credit the customer — the credit note is raised separately.

Sökvägsparametrar

Fält Typ Beskrivning
returnNumber Krävs string Return number of the approved return whose goods have arrived.

Body

Fält Typ Beskrivning
receivedDate string(date) · nullable Date the goods arrived. Defaults to today.

Svar

200 PublicReturnResponse
Fält Typ Beskrivning
createdDate string(date-time) UTC timestamp when the return was created.
currencyCode string · nullable ISO 4217 currency code the return is valued in.
customerNumber string · nullable Customer number the return belongs to. Null if the customer has no number.
externalNotes string · nullable Notes visible to the customer. Null if not set.
lines ReturnLine[] · nullable The return's lines.
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
modifiedDate string(date-time) · nullable UTC timestamp when the return was last modified. Null if never modified.
orderNumber string · nullable Order number the goods were returned from.
reason string · nullable Why the goods came back: Defective, WrongItem, DamagedInTransit, CustomerRemorse, Warranty, QualityIssue, OverDelivery or Other.
receivedDate string(date) · nullable Date the goods arrived back (ISO 8601 date). Null until received.
returnDate string(date) Date the return was registered (ISO 8601 date).
returnNumber string · nullable Unique return number.
rmaNumber string · nullable The customer's own RMA reference. Null if not set.
status enum Status of a customer return. Draft Approved Received CreditNoted Closed Cancelled
totalAmount decimal Net total of the returned lines. Serialised as a decimal string.
totalVat decimal Total VAT on the returned lines. Serialised as a decimal string.
warehouseCode string · nullable Warehouse the goods are returned to.
404 ProblemDetails No return with that return number.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The return has not been approved, or it has already been received.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 400 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.erp.fluit.cloud/preview/returns/{returnNumber}/receive" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Backdate the receipt
{
  "receivedDate": "2026-08-05"
}
Receive today
{}
Svar 200
{
  "createdDate": "2026-06-11T09:24:13.418",
  "currencyCode": "SEK",
  "customerNumber": "CUST-001",
  "externalNotes": "string",
  "lines": [
    {
      "condition": "string",
      "itemName": "Widget A",
      "itemNumber": "WIDGET-A",
      "lineNumber": 1,
      "lineTotal": "299.00",
      "notes": "string",
      "orderLineNumber": 42,
      "quantity": "10",
      "unitPrice": "299.00"
    }
  ],
  "links": {
    "self": "string"
  },
  "modifiedDate": "2026-06-11T09:24:13.418",
  "orderNumber": "SO-2026-1041",
  "reason": "string",
  "receivedDate": "2026-06-11",
  "returnDate": "2026-06-11",
  "returnNumber": "RMA-2026-0037",
  "rmaNumber": "ABC-001",
  "status": "Draft",
  "totalAmount": "299.00",
  "totalVat": "299.00",
  "warehouseCode": "MAIN"
}

Bas-URL https://api.erp.fluit.cloud/preview. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

Scheman

Objekten som gruppens anrop refererar till. Fälttabellerna ovan går ett steg djupt och länkar hit i stället för att upprepa samma schema på varje endpoint.

CreateReturnLine

CreateReturnLineInput
Fält Typ Beskrivning
condition enum Resellable Damaged Defective ForDisposal
notes string · nullable Free-text notes on the line.
orderLineNumber integer Line number on the sales order being returned.
quantity decimal Quantity returned. Must be greater than zero.

ReturnLine

PublicReturnLineResponse

A line on a customer return.

Fält Typ Beskrivning
condition string · nullable Condition the goods came back in.
itemName string · nullable Display name of the item.
itemNumber string · nullable Item number being returned.
lineNumber integer Line number, unique within the return.
lineTotal decimal Line total excluding VAT. Serialised as a decimal string.
notes string · nullable Free-text notes on the line. Null if not set.
orderLineNumber integer Line number on the originating sales order.
quantity decimal Quantity returned. Serialised as a decimal string.
unitPrice decimal Unit price credited. Serialised as a decimal string.