Create a return line item

How to create a return line item via API

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

Request

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

Arguments

Example

The following request creates a new return line item:

curl -g -X POST \
  'https://yourdomain.commercelayer.io/api/return_line_items' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "return_line_items",
    "attributes": {
      "quantity": 4
    },
    "relationships": {
      "return": {
        "data": {
          "type": "returns",
          "id": "ABCRtyUpBa"
        }
      },
      "line_item": {
        "data": {
          "type": "line_items",
          "id": "BCDRtyUpBa"
        }
      }
    }
  }
}'

Last updated