# Sales Returns

`GET /inventory/sales-returns`

Group: Inventory › Sales Returns · Operation ID: `salesReturns`

Returns a list of sales returns. To filter by customer, reference number, tracking number, item or warehouse, use POST inventory/sales-returns/search.

The sales return collection. It returns headers only: a nested array has no representation here, so lineCount stands in for the lines. GET inventory/sales-returns/:id and POST inventory/sales-returns/search return the full document. The customer, their reference number and the carrier's tracking number are returned but not filterable here. They identify a person and their transaction, so they belong in a request body. POST inventory/sales-returns/search takes all three. entityId is filterable, so a collection can be scoped to one legal entity. Filtering by item or warehouse is not possible here because both live on the lines. Search takes them.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=salesReturns)

## 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`. |

## Query surface

- `id` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `documentNumber` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `documentStatus` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `documentDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `deliveryDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `entityId` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `returnType` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `lastModifiedDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- Orderable: id, documentNumber, documentDate, deliveryDate, documentStatus, totalAmount, createdDate, lastModifiedDate
- Selectable: id, documentNumber, documentStatus, documentDate, deliveryDate, entityId, entityName, businessPartnerId, businessPartnerName, currency, totalAmount, returnFeeAmount, returnType, lineCount, referenceNumber, trackingNumber, sourceDocumentId, sourceDocumentType, notes, createdDate, lastModifiedDate

## Response

`200` Success

Under `data`, an array of salesReturnsRow:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The unique identifier for the sales return. |
| `documentNumber` | string or null | no | The sales return number, for example 'SR-1042'. Assigned on create. |
| `documentStatus` | string | no | The status of the return. Possible values: 'DRAFT', 'OPEN', 'COMMITTED', 'RECEIVED', 'INSPECTED', 'PROCESSED', 'COMPLETED', 'CANCELLED'. |
| `documentDate` | string (date) | no | The date the return is dated. Format YYYY-MM-DD. |
| `deliveryDate` | string (date) or null | no | When the goods are expected back, or came back. Format YYYY-MM-DD. |
| `entityId` | string | no | The unique identifier for the legal entity. See id on GET base/entities. |
| `entityName` | string or null | no | The name of that legal entity. |
| `businessPartnerId` | string | no | The unique identifier for the customer. Despite the name, this is a customer id. See id on GET accounting/customers/:id. |
| `businessPartnerName` | string or null | no | The name of that customer. |
| `currency` | string or null | no | The currency the return is valued in. Format ISO 4217, for example 'EUR'. |
| `totalAmount` | string (decimal) or null | no | The total value of the return, in the return's currency. |
| `returnFeeAmount` | string (decimal) or null | no | The fee withheld across the return, in the document's currency. |
| `returnType` | string or null | no | How the business classifies the return. |
| `lineCount` | number or null | no | How many lines the return has. Published because the lines themselves are not. |
| `referenceNumber` | string or null | no | The customer's own reference for the return, for example an RMA number. |
| `trackingNumber` | string or null | no | The carrier's tracking number for the returned goods. |
| `sourceDocumentId` | string or null | no | The document the goods went out on, where the platform recorded one, as its own numeric id in a string. It is not an identifier this API can look up. The usable link is sourceDocumentLineId on the line, which GET inventory/sales-returns/:id and POST inventory/sales-returns/search return. |
| `sourceDocumentType` | string or null | no | What kind of document that id refers to, for example 'SalesDelivery'. |
| `notes` | string or null | no | Free text on the document. |
| `createdDate` | string (date-time) or null | no | The date and time the return was created, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |
| `lastModifiedDate` | string (date-time) or null | no | The date and time the return record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |

## Statuses

- `400` — Invalid request or business failure
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
