Refund Reasons API Routes

A refund reason is a possible reason used when issuing a refund to the customer, such as when returning an item and refunding the customer.

These API routes allow admin users to manage refund reasons.

GET /admin/refund-reasons#

List Refund Reasons

Retrieve a list of refund reasons. The refund reasons can be filtered by fields such as id. The refund 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 -.
idstring | string[]Optional
Filter by a refund reason's ID.
qstringOptional
Search term to filter the refund reason's searchable properties.
$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.
refund_reasonsobject[]
The refund reason's refund reasons.

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


POST /admin/refund-reasons#

Create Refund Reason

Create a refund 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)

labelstring
The refund reason's label.
descriptionstringOptional
The refund reason's description.
codestring
The refund reason's code.

Request examples

Responses

200 OK

refund_reasonobject
The refund reason's details.

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


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

Get a Refund Reason

Retrieve a refund reason by its ID. You can expand the refund 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 refund 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

refund_reasonobject
The refund reason's details.

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


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

Update a Refund Reason

Update a refund reason's details.

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

Path parameters

idstring
The refund 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)

labelstringOptional
The refund reason's label.
descriptionstringOptional
The refund reason's description.
codestringOptional
The refund reason's code.

Request examples

Responses

200 OK

refund_reasonobject
The refund reason's details.

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


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

Delete a Refund Reason

Delete a refund reason.

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

Path parameters

idstring
The refund reason's ID.

Request examples

Responses

200 OK

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

Default: "refund_reason"

deletedboolean
Whether the refund 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