Returns
A comprehensive list of the return resource's fields and attributes
Returns are linked to one specific order. Commerce Layer Metrics API lets you perform different types queries on the /returns/{{query_type}}
endpoint to gather stats and information about your organization return history:
The results of each query can be filtered based on specific fields and operators:
FiltersYou can easily see it in action by checking these simple examples:
ExamplesFields and attributes
Please reference to this list for a comprehensive view of all the return resource's fields and attributes, accessible through the Metrics API:
customer
field
customer
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the customer. |
| String | The email address of the customer. |
| String | The name of the customer group the customer belongs to (if any). |
destination_address
field
destination_address
fieldAttribute | Type | Description |
---|---|---|
| Boolean | Indicates if the address is a business or a personal one. |
| String | The city specified in the address. |
| String | The international 2-letter country code (as defined by the ISO 3166-1 standard) specified in the address. |
| Boolean | Indicates if the address has been successfully geocoded. |
| Boolean | Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. |
| String | The state, province or region code specified in the address. |
| String | The ZIP or postal code specified in the address. |
origin_address
field
origin_address
fieldAttribute | Type | Description |
---|---|---|
| Boolean | Indicates if the address is a business or a personal one. |
| String | The city specified in the address. |
| String | The international 2-letter country code (as defined by the ISO 3166-1 standard) specified in the address. |
| Boolean | Indicates if the address has been successfully geocoded. |
| Boolean | Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. |
| String | The state, province or region code specified in the address. |
| String | The ZIP or postal code specified in the address. |
market
field
market
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the market. |
| String | The name of the market. |
| Integer | The numeric unique identifier for the market. |
return
field
return
fieldAttribute | Type | Description |
---|---|---|
| String | The lower limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The upper limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date field (e.g. |
| String | The date and time at which the return was approved (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the return was archived (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| Boolean | Indicates if the return has been archived. |
| String | The date and time at which the return was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the return was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The numeric unique identifier for the return. |
| String | The date and time at which the return was received (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | Any external identifier that might be useful to link the return resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
| String | The date and time at which the return was rejected (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the return was shipped (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The return status. One of |
| String | The date and time at which the return was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time of the return's latest status change, regardless of the return's status (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The ID of the return. |
| String | The ID of the order associated with the return. |
| Integer | The total number of SKUs in the return's line items. |
return_line_items
field
return_line_items
fieldAttribute | Type | Description |
---|---|---|
| String | The date and time at which the return line item was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| Integer | The return line item quantity. |
| String | The date and time at which the return line item was restocked (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The ID of the return line item. |
| String | The code of the associated SKU or bundle. |
| String | The type of the associated item. One of |
| Number | The total amount of the return line item (float). |
| Number | The collected tax amount for the return line item (float). |
| Number | The tax rate for the return line item (if calculated). |
| String | The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
stock_location
field
stock_location
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the stock location. |
| String | The name of the stock location. |
| String | Any external identifier that might be useful to link the stock location resource to other systems through the Commerce Layer core API. |
| String |
tags
field
tags
fieldAttribute | Type | Description |
---|---|---|
| String | The tag ID. |
| String | The tag name. |
Last updated