Return API

Introduction

The Return API provides endpoints for creating a return cart.

For more details about this API usage, check out the documentation

Preparation

  • Have an authenticated token from the authentication service, this token should be used as an authorization bearer token in the header for every request made to this API (more information about the authorization service here).
  • Have the cart ID you wish to make a return for (more information about carts here).
  • That the cart ID you are using has been purchased using the payment API (more information about payments here).

Create Return Cart

This endpoint is for creating a return cart with reference to a previously purchased cart. To create the return, make a POST request to /returns. It is necessary to provide the refCartId inside the request body, alongside with a list of items that will be returned.

Example request:

{
"refCartId": "f22e122d-f3ed-482d-b917-8589bd6e8b9b",
"items": [
{
"positionId": 2,
"quantity": 1,
"reasonId": 3,
"reasonName": "Defective zipper"
}
]
}

In the response we expect to get a new cart. This cart will hold a list of items that are returned. It also keeps a refCartId which is a reference to the previously purchased cart.

Create manual Return Cart

This endpoint is for creating a manual return cart with no reference to a previously purchased cart. To create the return, make a POST request to /returns/manual. Provide a refLegacyBarcode and manualReturnCartReason alongside the list of items that will be returned.

Example request:

{
"refLegacyBarcode": 1903190211102000000,
"manualReturnCartReason": "Valid receipt but missing in the system",
"items": [
{
"sku": 10005,
"quantity": 1,
"basePrice": {
"value": 2399,
"currency": "EUR"
},
"pseudoItemComment": "Leather boots for men",
"reasonId": 3,
"reasonName": "Defective zipper"
}
]
}