Update Document

This endpoint allows updating the content of an existing document in a shipment.

Document Identifier: The document_identifier path parameter can be either:

  • The document_id of the document
  • The name of the document (URL-encoded if it contains special characters or spaces)

Important Behavior:

  • The document must already exist in the shipment.
  • The document content must be provided as a Base64-encoded string.
  • Only PDF format is currently supported.
  • Security validation is performed on the new content.
  • The new content will replace the existing document content in storage.

Automatic Carrier Upload: Similar to the upload endpoint, if the document setting is configured for carrier upload and the shipment meets the criteria, the updated document will be automatically uploaded to the carrier.

The shipment_id is used as a path parameter to identify the shipment. Alternatively the merchant provided shipment reference (partner_shipment_reference) can also be used instead of the shipment_id.

SecurityOAuth2-Production or OAuth2-Demo
Request
path Parameters
shipment_id
required
string

The Carriyo shipment ID or the merchant provided partner_shipment_reference.

document_identifier
required
string

The document ID or document name (URL-encoded) to identify the document to update.

header Parameters
x-api-key
required
string
tenant-id
required
string
Content-Type
required
string
Default: application/json
Request Body schema: application/json
required
content_base64
required
string

The new document content encoded as a Base64 string. This will replace the existing document content.

Responses
200

Document updated successfully. Returns the updated shipment object.

400

Bad Request - Document not found or validation failed.

404

Shipment not found.

put/shipments/{shipment_id}/documents/{document_identifier}
Request samples
application/json
{
  • "content_base64": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PgplbmRvYmoKMiAwIG9iago..."
}
Response samples
application/json
{
  • "shipment_id": "XYZABC123",
  • "entity_type": "FORWARD",
  • "merchant": "MY_BRAND",
  • "references": {
    },
  • "carrier_account": {
    },
  • "payment": {
    },
  • "insurance": {
    },
  • "collection": {
    },
  • "delivery": {
    },
  • "pickup": {
    },
  • "dropoff": {
    },
  • "items": [
    ],
  • "freight": {
    },
  • "customs": {
    },
  • "charges": [
    ],
  • "parcels": [
    ],
  • "post_shipping_info": {
    },
  • "custom_attributes": { },
  • "order_date": "2022-01-01T09:00:00.000Z",
  • "order_type": "HOME_DELIVERY",
  • "creation_date": "2022-01-01T09:00:00.000Z",
  • "update_date": "2022-01-01T09:00:00.000Z",
  • "confirmation_date": "2022-01-01T09:00:00.000Z",
  • "estimated_process_date": "2019-08-24T14:15:22Z",
  • "promised_delivery_date": "2022-01-01T09:00:00.000Z",
  • "original_promised_delivery_date": "2022-01-01T09:00:00.000Z",
  • "estimated_shipping_cost": {
    },
  • "language": "en",
  • "return_request_id": "rma_123abcXYZ"
}