Hoppa till innehållet

Returns

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

6 calls GET POST Base URL https://api.erp.fluit.cloud/preview

Authentication, error codes, rate limits, idempotency and pagination apply to every call and are documented once under Getting started.

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.

Query parameters

Field Type Description
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.

Responses

200 PagedResult_PublicReturnResponse

Paginated response: the fields below sit in items[], wrapped in totalCount, page, pageSize, totalPages, hasPreviousPage and hasNextPage. Paginated

Field Type Description
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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 401 403 Errors

Examples

curl
curl "https://api.erp.fluit.cloud/preview/returns" \
  -H "X-Api-Key: fluit_live_sk_..."
Response 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
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

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.

Show the full description

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 required

Field Type Description
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 Required string Sales order the goods are returned from.
reason Required 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.

Responses

201 PublicReturnResponse
  • Location — URL of the newly created resource.
Field Type Description
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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 401 403 409 Errors

Examples

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"
}
Response 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"
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

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 Supports ETag

Path parameters

Field Type Description
returnNumber Required string Return number of the customer return to read.

Responses

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.
Field Type Description
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 Empty 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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 401 403 Errors

Examples

curl
curl "https://api.erp.fluit.cloud/preview/returns/{returnNumber}" \
  -H "X-Api-Key: fluit_live_sk_..."
Response 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"
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

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.

Path parameters

Field Type Description
returnNumber Required string Return number of the return to approve.

Responses

200 PublicReturnResponse
Field Type Description
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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No return with that return number.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails The return is not in Draft.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 401 403 Errors

Examples

curl
curl -X POST "https://api.erp.fluit.cloud/preview/returns/{returnNumber}/approve" \
  -H "X-Api-Key: fluit_live_sk_..." \
  -H "Idempotency-Key: $(uuidgen)"
Response 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"
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

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 Paginated

Path parameters

Field Type Description
returnNumber Required string Return number of the return whose lines to list.

Query parameters

Field Type Description
page integer Page to return, 1-based. Default 1.
pageSize integer Number of records per page. Default 50, max 200.

Responses

200 PagedResult_PublicReturnLineResponse

Paginated response: the fields below sit in items[], wrapped in totalCount, page, pageSize, totalPages, hasPreviousPage and hasNextPage. Paginated

Field Type Description
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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 401 403 Errors

Examples

curl
curl "https://api.erp.fluit.cloud/preview/returns/{returnNumber}/lines" \
  -H "X-Api-Key: fluit_live_sk_..."
Response 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
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

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.

Show the full description

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.

Path parameters

Field Type Description
returnNumber Required string Return number of the approved return whose goods have arrived.

Body

Field Type Description
receivedDate string(date) · nullable Date the goods arrived. Defaults to today.

Responses

200 PublicReturnResponse
Field Type Description
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.
Field Type
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.
Field Type
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standard errors: 400 401 403 Errors

Examples

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
{}
Response 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"
}

Base URL https://api.erp.fluit.cloud/preview. The response example is generated from the schema: the shape is right, the values are made up.

Schemas

The objects this group's calls refer to. The field tables above go one level deep and link here rather than repeating the same schema on every endpoint.

CreateReturnLine

CreateReturnLineInput
Field Type Description
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.

Field Type Description
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.