# Update a Shipment

Endpoint: PUT /shipments/{shipment_id}
Version: V5
Security: bearerAuth, basicAuth

## Path parameters:

  - `shipment_id` (string, required)
    ID of the Shipment to update

## Request fields (application/json):

  - `merchant_invoice_id` (string)
    ID of the merchant invoice (must belong to the authenticated merchant).
    Example: inv_9876543210fedcba

  - `shipment_tracking_number` (string)
    Tracking number for the shipment.
    Example: 1Z987F65432109876

  - `shipment_courier` (string)
    Shipping courier or provider name. While any value can be accepted, instant verification is supported for specific couriers.
See the [Shipments API documentation](#tag/Shipments) for the complete list of supported couriers.
    Example: fedex

  - `file` (object)

  - `file.url` (string, required)
    S3 URL of the uploaded file obtained after uploading to the signed URL from `/shipments/sign-upload`.
    Example: https://bucket.s3.amazonaws.com/1234567890-document.pdf

  - `file.size` (integer, required)
    File size in bytes.
    Example: 204800

  - `file.metadata` (object)
    Optional metadata about the file.
    Example: {"original_filename":"proof_of_delivery.pdf"}

  - `file.metadata.original_filename` (string)
    Original filename before upload.
    Example: proof_of_delivery.pdf

## Response 200 fields (application/json):

  - `id` (string)
    Unique identifier of the Shipment.
    Example: ship_1234567890abcdef

  - `merchant_invoice_id` (string)
    ID of the associated merchant invoice.
    Example: inv_1234567890abcdef

  - `fulfillment_method` (string)
    Method of fulfillment for the shipment.
    Enum: "shipping_provider", "self_delivery", "customer_pickup", "services_only"

  - `shipment_tracking_number` (string)
    Tracking number provided by the shipping courier.
    Example: 1Z123E45678901234

  - `shipment_courier` (string)
    Shipping courier or provider name. While any value can be accepted, instant verification is supported for specific couriers.
See the [Shipments API documentation](#tag/Shipments) for the complete list of supported couriers.
    Example: ups

  - `verification_status` (string)
    Manual or automatic verification status of the shipment.
    Enum: "verified", "pending"

  - `created_at` (string)
    Date time when the shipment was created.
    Example: 2024-01-15T10:30:00Z

  - `updated_at` (string)
    Date time when the shipment was last updated.
    Example: 2024-01-15T14:45:00Z

  - `tracking_status` (string)
    Current tracking status of the shipment from the courier.
    Example: delivered

  - `tracking_substatus` (string)
    Detailed tracking substatus providing additional context about the shipment's current state.
    Example: delivered_001

  - `expected_delivery` (string)
    Expected delivery date and time provided by the shipping courier.
    Example: 2024-01-20T18:00:00Z

## Response 400 fields (application/json):

  - `error` (object)

  - `error.message` (string)
    A short string, describing error details
    Example: Validation error

  - `error.type` (string)
    A short string, describing error type
    Enum: "validation_error"

  - `error.details` (array)

  - `error.details.path` (string)
    Path to the field failed validation
    Example: path.to.field

  - `error.details.message` (string)
    Detailed description of the error
    Example: `[field]` is required

## Response 401 fields (application/json):

  - `error` (object)

  - `error.message` (string)
    A short string, describing error details
    Example: Invalid merchant credentials

  - `error.type` (string)
    A short string, describing error type
    Enum: "authentication_error"

## Response 404 fields (application/json):

  - `error` (object)

  - `error.message` (string)
    A short string, describing error details
    Example: [entity] not found

  - `error.type` (string)
    A short string, describing error type
    Enum: "not_found_error"

## Response 429 fields (application/json):

  - `error` (object)

  - `error.message` (string)
    A short string, describing error details
    Example: Too many requests

  - `error.type` (string)
    A short string, describing error type
    Enum: "rate_limit_error"

