Create a return

How to create a return via API

To create a new return, send a POST request to the /api/returns endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/returns

Arguments

Body ParameterTypeRequired

type

string

Required

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.order

object

Required

relationships.stock_location

object

Optional

relationships.reference_capture

object

Optional

relationships.tags

array

Optional

Example

The following request creates a new return:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/returns' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "returns",
    "relationships": {
      "order": {
        "data": {
          "type": "orders",
          "id": "ABCRtyUpBa"
        }
      }
    }
  }
}'

Last updated