Back to siteAPI Documentation
PATCH

/api/v1/shipments/{shipment_id}

Auth: Bearer token

Update Shipment

Updates shipment details before delivery completion.

Path parameters

NameTypeRequiredDescription
shipment_idstringYesShipment identifier.

Body parameters

NameTypeRequiredDescription
merchant_order_refstringNoUpdated merchant order reference.
collection_datestringNoUpdated collection datetime in ISO-8601 format.
pickup_addressobjectNoUpdated pickup address object.
dropoff_addressobjectNoUpdated dropoff address object.
pickup_instructionsstringNoUpdated pickup instructions.
dropoff_instructionsstringNoUpdated dropoff instructions.
ready_atstringNoUpdated ready datetime in ISO-8601 format.
metadataobjectNoArbitrary metadata object.
parcelsarrayNoUpdated parcel list.
parcels[].weight_kgnumberNoParcel weight in kilograms.
parcels[].length_cmnumberNoParcel length in centimeters.
parcels[].width_cmnumberNoParcel width in centimeters.
parcels[].height_cmnumberNoParcel height in centimeters.

Example response

<?php

return [
  'success' => true,
  'data' => [
    'shipment_id' => 'shp_101',
    'merchant_id' => 'mrc_001',
    'environment_id' => 'env_live_001',
    'merchant_order_ref' => 'ORD-8842',
    'collection_date' => '2026-02-18',
    'status' => 'ready',
    'pickup_address' => [
      'location_id' => 'loc_001',
      'name' => 'Warehouse A',
      'address_line_1' => '12 Jet Park Rd',
      'city' => 'Johannesburg',
      'country' => 'ZA',
      'post_code' => '1459',
      'latitude' => -26.1367,
      'longitude' => 28.2225
    ],
    'dropoff_address' => [
      'location_id' => 'loc_002',
      'name' => 'Warehouse A',
      'address_line_1' => '95 Bree St',
      'city' => 'Cape Town',
      'country' => 'ZA',
      'post_code' => '1459',
      'latitude' => -26.1367,
      'longitude' => 28.2225
    ],
    'pickup_instructions' => 'Collect from loading bay 2',
    'dropoff_instructions' => 'Call on arrival',
    'ready_at' => '2026-02-18T07:30:00Z',
    'metadata' => [
      'source' => 'shopify'
    ],
    'parcels' => [
      [
        'parcel_id' => 'prc_001',
        'weight_kg' => '3.50',
        'length_cm' => '35',
        'width_cm' => '22',
        'height_cm' => '18',
        'declared_value' => '899.00',
        'contents_description' => 'Electronics accessories'
      ]
    ],
    'created_at' => '2026-02-17T10:22:00Z'
  ]
];

Request examples

curl -X PATCH \
  "https://api.spaces.za.com/api/v1/shipments/shp_101" \
  -H "Authorization: Bearer <token>" \\
  -H "Content-Type: application/json" \\
  --data '{
  "dropoff_address": {
    "address_line_1": "95 Bree St",
    "city": "Cape Town",
    "country": "ZA"
  },
  "dropoff_instructions": "Call 5 minutes before arrival",
  "metadata": {
    "priority": "high"
  }
}'