Update a parcel

How to update an existing parcel via API

To update an existing parcel, send a PATCH request to the /api/parcels/: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/parcels/:id

Arguments

Body Parameter
Type
Required

type

string

Required

id

string

Required

attributes.weight

float

Optional

attributes.unit_of_weight

string

Optional

attributes.eel_pfc

string

Optional

attributes.contents_type

string

Optional

attributes.contents_explanation

string

Optional

attributes.customs_certify

boolean

Optional

attributes.customs_signer

string

Optional

attributes.non_delivery_option

string

Optional

attributes.restriction_type

string

Optional

attributes.restriction_comments

string

Optional

attributes.customs_info_required

boolean

Optional

attributes.shipping_label_url

string

Optional

attributes.shipping_label_file_type

string

Optional

attributes.shipping_label_size

string

Optional

attributes.shipping_label_resolution

string

Optional

attributes.tracking_number

string

Optional

attributes.tracking_status

string

Optional

attributes.tracking_status_detail

string

Optional

attributes.tracking_status_updated_at

datetime

Optional

attributes.tracking_details

object

Optional

attributes.carrier_weight_oz

string

Optional

attributes.signed_by

string

Optional

attributes.incoterm

string

Optional

attributes.delivery_confirmation

string

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.shipment

object

Optional

relationships.package

object

Optional

Example

The following request updates the parcel identified by the ID "xYZkjABcde":

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

Last updated