Skip to main content

Make a order items refund

How to make the refund of an order items list

Before starting

Before making any call to Api Orders, it is necessary to obtain a valid OAuth access token.

Prerequisites!

You will need a valid OAuth access_token to be able to use the next endpoint! Please refer to our Authentication Guide to obtain one.

We obtain the ID of the items what do we need to refund

The following example Postman Curl, show a call to api-orders that returns the information of an order in detail, also includes the list of items it contains, so we will get the ids we need to make the return in the next call:

  • order-code: This parameter indicates the order code from which we want to return the items.
curl --location --request GET 'https://api.oneboxtds.net/orders-mgmt-api/v1/orders/{{order-code}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access-token}}'

Notes:

  • Please note that a refund cannot be done if any of the items obtained here and and sent on the next call in REFUNDED status, that would mean that this item is already returned, and therefore the api will return an error 409 with the message PRODUCT_STATE_INVALID.

We make the refund of the desired items using the following endpoint

The following example Postman Curl, will refund the items indicated in the items list that we send in the JSON body:

  • order-code: This parameter indicates the order code from which we want to return the items.
  • items: This parameter indicates the list of the order items that we want to refund (note that is a request body parameter).
curl --location --request POST 'https://api.oneboxtds.net/orders-mgmt-api/v1/orders/{{order-code}}/refund' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {{access-token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"items": [
{
"id": 148484477
}
],
"type": "MANUAL",
"include_surcharges": true,
"include_delivery": false,
"include_insurance": false,
"payments": null
}'

Notes:

  • Please note that for this call to work properly, the access token you use must be authenticated as seller channel client and using the channel-id to which the sale belongs. To know how to obtain this access token visit our Booking to purchase guide.