Update a stock transfer

How to update an existing stock transfer via API

To update an existing stock transfer, send a PATCH request to the /api/stock_transfers/:id endpoint, where id is the ID of the resource that you want to update.

Here below the list of all the possible arguments that you can pass with the request body.

Request

PATCH https://yourdomain.commercelayer.io/api/stock_transfers/:id

Arguments

Body ParameterTypeRequired

type

string

Required

id

string

Required

attributes.number

string

Optional

attributes.sku_code

string

Optional

attributes._upcoming

boolean

Optional

attributes._on_hold

boolean

Optional

attributes._picking

boolean

Optional

attributes._in_transit

boolean

Optional

attributes._complete

boolean

Optional

attributes._cancel

boolean

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.sku

object

Optional

relationships.origin_stock_location

object

Optional

relationships.destination_stock_location

object

Optional

relationships.shipment

object

Optional

relationships.line_item

object

Optional

Example

The following request updates the stock transfer identified by the ID "xYZkjABcde":

curl -g -X PATCH \
  'https://yourdomain.commercelayer.io/api/stock_transfers/xYZkjABcde' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "stock_transfers",
    "id": "xYZkjABcde",
    "attributes": {
      "sku_code": "TSHIRTMM000000FFFFFFXLXX"
    },
    "relationships": {
      "sku": {
        "data": {
          "type": "skus",
          "id": "ABCRtyUpBa"
        }
      }
    }
  }
}'

Last updated