Search Accounting Sales Return
POST /accounting/sales-returns/search
Group: Accounting › Sales Returns · Operation ID: searchAccountingSalesReturn
Returns the sales returns that match the given filters, each with its lines.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Request body
Required, application/json: searchAccountingSalesReturnInput.
| Field | Type | Required | Description |
|---|---|---|---|
filters |
object | no | The filters to apply. A sales return must match every filter you send. Omit to return all sales returns. |
filters.id |
string | no | Limits results to the sales return with this identifier. |
filters.salesReturnNumber |
string | no | Limits results to the sales return with this RMA number, for example 'SR-104'. |
filters.status |
array of string | no | Limits results to sales returns in any of these statuses. Accepted values: 'draft', 'submitted', 'received', 'approved', 'completed', 'cancelled', 'rejected'. An unknown value matches nothing. An empty array does not constrain. |
filters.returnType |
array of string | no | Limits results to sales returns of any of these resolution paths. Accepted values: 'credit', 'replacement'. An unknown value matches nothing. An empty array does not constrain. |
filters.reasonCode |
array of string | no | Limits results to sales returns with any of these header-level reasons. Accepted values: 'defectiveItem', 'wrongItemShipped', 'damagedInTransit', 'customerRequest', 'duplicateOrder', 'notAsDescribed', 'other'. An empty array does not constrain. |
filters.salesOrderId |
string | no | Limits results to sales returns raised against the sales order with this identifier. An identifier matching no sales order returns an empty page. |
filters.currency |
string | no | Limits results to sales returns in this currency. Format ISO 4217, for example 'USD'. |
filters.notes |
string | no | Limits results to sales returns whose notes contain this text. The match is case-insensitive. |
filters.returnTrackingNumber |
string | no | Limits results to the sales return with this carrier tracking number. |
filters.returnDate |
object | no | Limits results to sales returns whose returnDate falls in this range. Omit either bound to leave that side open. |
filters.returnDate.start |
string (date) | no | The earliest date to include. Format YYYY-MM-DD. |
filters.returnDate.end |
string (date) | no | The latest date to include. Format YYYY-MM-DD. |
filters.lastModifiedDate |
object | no | Limits results to sales returns changed in this range, for polling an incremental sync. Omit either bound to leave that side open. |
filters.lastModifiedDate.start |
string | no | The earliest time to include, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
filters.lastModifiedDate.end |
string | no | The latest time to include, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
page |
object | no | The pagination controls. Omit for the first page. |
page.cursor |
string | no | The cursor from the previous response's pagination.nextCursor. Omit for the first page. |
page.size |
number | no | The number of sales returns per page. Defaults to 50. A value above 200 is treated as 200, not rejected. |
Example:
{
"filters": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"salesReturnNumber": "<salesReturnNumber>",
"status": [
"<status>"
],
"returnType": [
"<returnType>"
],
"reasonCode": [
"<reasonCode>"
],
"salesOrderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"currency": "<currency>",
"notes": "<notes>",
"returnTrackingNumber": "<returnTrackingNumber>",
"returnDate": {
"start": "2026-01-15",
"end": "2026-01-15"
},
"lastModifiedDate": {
"start": "<start>",
"end": "<end>"
}
},
"page": {
"cursor": "<cursor>",
"size": 0
}
}
Response
200 Success
Under data (searchAccountingSalesReturnOutput):
| Field | Type | Required | Description |
|---|---|---|---|
items |
array of object | yes | The sales returns on this page, oldest first. An empty array when nothing matches. |
items[].id |
string | yes | The unique identifier for the sales return. |
items[].salesReturnNumber |
string | no | The RMA number, for example 'SR-1'. Absent while none has been assigned. |
items[].status |
string | yes | The lifecycle status of the sales return. Possible values: 'draft', 'submitted', 'received', 'approved', 'completed', 'cancelled', 'rejected'. |
items[].returnType |
string | yes | The resolution path for the return. Possible values: 'credit', 'replacement'. It cannot be changed once status moves past 'draft'. |
items[].returnDate |
string | yes | The transaction date for the return. Format YYYY-MM-DD. |
items[].salesOrderId |
string | yes | The sales order this return is against. A sales return is always against exactly one sales order. See id on GET accounting/sales-orders/:id. |
items[].currency |
string | yes | The currency of every amount on this record and its lines. Format ISO 4217, for example 'USD'. |
items[].reasonCode |
string | no | The customer-facing reason for the return. Possible values: 'defectiveItem', 'wrongItemShipped', 'damagedInTransit', 'customerRequest', 'duplicateOrder', 'notAsDescribed', 'other'. It is for reporting and does not affect how the return is resolved. |
items[].notes |
string | no | Free-form notes for the return. |
items[].returnTrackingNumber |
string | no | The carrier tracking number for the inbound return shipment. |
items[].totalReturnAmount |
string (decimal) | no | The total return amount, the sum of every line's totalPrice, in the return currency. |
items[].returnFeeAmount |
string (decimal) | no | The fee deducted from the customer refund, such as a restocking fee, in the return currency. Credit returns only. It is set either here or on the lines, never both. |
items[].shippingRefundAmount |
string (decimal) | no | The shipping charge refunded to the customer, in the return currency. Credit returns only. |
items[].totalRevenueImpact |
string (decimal) | no | The revenue reversed to the customer, the product-line revenue impact plus the shipping refund, in the return currency. Always 0 for the replacement path. |
items[].revenueStatus |
string | no | The revenue reversal status. Possible values: 'notApplicable', 'notStarted', 'reversed'. 'notApplicable' is the replacement path, and 'reversed' is a completed credit return. |
items[].inventoryReturnNumber |
string | no | The document number of the linked inventory sales return. Absent until one has been created. |
items[].lastModifiedDate |
string (date-time) | yes | The date and time the sales return last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
items[].lines |
array of object | yes | The product lines being returned. |
items[].lines[].id |
string | yes | The unique identifier for this return line. |
items[].lines[].salesOrderProductLineId |
string | yes | The sales order product line this line returns. There is no endpoint for it. |
items[].lines[].lineType |
string | yes | The product line type, copied from the sales order line at creation. |
items[].lines[].quantity |
string (decimal) | yes | The quantity being returned. |
items[].lines[].unitOfMeasure |
string | yes | The unit of measure, copied from the sales order line. |
items[].lines[].currency |
string | yes | The currency of unitPrice, totalPrice and returnFeeAmount on this line, copied from the sales return. Format ISO 4217, for example 'USD'. |
items[].lines[].unitPrice |
string (decimal) | yes | The unit price, copied from the sales order line at creation, in this line's currency. |
items[].lines[].totalPrice |
string (decimal) | no | The total price for the line, quantity times unitPrice, in this line's currency. |
items[].lines[].returnFeeAmount |
string (decimal) | no | The fee deducted from the customer refund for this line, in this line's currency. Credit returns only. Set only when fees are tracked per line rather than on the header. |
items[].lines[].revenueImpactAmount |
string (decimal) | no | The revenue reversed for this line, in this line's currency. 0 for the replacement path. |
items[].lines[].lineStatus |
string | yes | The lifecycle status of this line. Possible values: 'pending', 'received', 'approved', 'completed', 'cancelled', 'rejected'. |
pagination |
object | yes | The pagination cursor for this page. |
pagination.nextCursor |
string | no | The cursor for the next page. Pass it as page.cursor. Absent on the last page. |
pagination.hasMore |
boolean | yes | True when more sales returns remain beyond this page. |
Errors
| Code | Status |
|---|---|
INVALID_TIMESTAMP |
400 |
Statuses
400— Invalid request or business failure. Codes: INVALID_TIMESTAMP401— Missing or invalid access token403— Not authorized404— Not found429— Too many requests500— Internal server error