Return Reasons API Routes

A return reason is a possible reason that an item is returned from the customer, such as when returning an item.

These API routes allow admin users to manage return reasons.

GET /admin/return-reasons#

List Return Reasons

Retrieve a list of return reasons. The return reasons can be filtered by fields such as id. The return reasons can also be sorted or paginated.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
offsetnumberOptional
The number of items to skip when retrieving a list.
limitnumberOptional
Limit the number of items returned in the list.
orderstringOptional
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
qstringOptional
Search term to filter the return reason's searchable properties.
idstring | string[]Optional
Filter by a return reason ID.
valuestring | string[]Optional
Filter by a return reason's value.
labelstring | string[]Optional
Filter by a return reason's label.
descriptionstring | string[]Optional
Filter by a description. This filter looks for an exact match of the return reason's description. To search by a term or keywords, use the q query parameter instead.
parent_return_reason_idstring | string[]Optional
Filter by a return reason's ID to retrieve its child return reasons.
created_atobjectOptional
Filter by a return reason's creation date. Accepts the filter operators.
updated_atobjectOptional
Filter by a return reason's update date. Accepts the filter operators.
deleted_atobjectOptional
Filter by a return reason's deletion date. Accepts the filter operators.
$andobject[]Optional
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
$orobject[]Optional
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
with_deletedbooleanOptional
Whether to include deleted records in the result.

Request examples

Responses

200 OK

limitnumber
The maximum number of items returned.
offsetnumber
The number of items skipped before retrieving the returned items.
countnumber
The total number of items.
return_reasonsobject[]
The list of return reasons.
estimate_countnumberOptional
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/return-reasons#

Create Return Reason

Create a return reason.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

valuestring
The return reason's value.
labelstring
The return reason's label.
descriptionstringOptional
The return reason's description.
parent_return_reason_idstringOptional
The ID of the parent return reason.
metadataobjectOptional
The return reason's metadata, can hold custom key-value pairs. Learn more in the Manage Metadata section.

Request examples

Responses

200 OK

return_reasonobject
The return reason's details.

400, 401, 404, 409, 422, 500: an error response is returned.


GET /admin/return-reasons/{id}#

Get a Return Reason

Retrieve a return reason by its ID. You can expand the return reason's relations or select the fields that should be returned.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The return reason's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request examples

Responses

200 OK

return_reasonobject
The return reason's details.

400, 401, 404, 409, 422, 500: an error response is returned.


POST /admin/return-reasons/{id}#

Update a Return Reason

Update a return reason's details.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The return reason's ID.

Query parameters

fieldsstringOptional
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.

Request body (application/json)

labelstring
The return reason's label.
valuestring
The return reason's value.
descriptionstringOptional
The return reason's description.
metadataobjectOptional
The return reason's metadata, can hold custom key-value pairs. Learn more in the Manage Metadata section.

Request examples

Responses

200 OK

return_reasonobject
The return reason's details.

400, 401, 404, 409, 422, 500: an error response is returned.


DELETE /admin/return-reasons/{id}#

Delete a Return Reason

Delete a return reason.

Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.

Path parameters

idstring
The return reason's ID.

Request examples

Responses

200 OK

idstring
The return reason's ID.
objectstring
The name of the deleted object.

Default: "return_reason"

deletedboolean
Whether the return reason was deleted.

400, 401, 404, 409, 422, 500: an error response is returned.

Found a problem with this page?Report Issue
Edited Nov 14·Edit this page