Bulk Upload Shipment Attachments

View as Markdown
Uploads a single file to one or more shipments (1–250) in a single request. The endpoint enforces the full server-side attachment-type validation matrix — attachment type eligibility, label state, shipment state, order type, retailer program, and max-one rules — and records the uploader. Request must be sent as **multipart/form-data** with the following fields: | Field | Type | Required | Description | |-------|------|----------|-------------| | file | file | Yes | The binary file content to upload. Supported types: PDF, JPG/JPEG, PNG (max 3 MB). Magic-byte validation is applied in addition to extension checks. | | shipment_ids | integer (repeated field) | Yes | 1–250 shipment IDs to attach the file to. Repeat the field once per ID (e.g. `shipment_ids=123456&shipment_ids=789012`) — not a JSON array. | | attachment_type_id | integer | Yes | The attachment type (0–16). | **Per-shipment results:** every shipment is evaluated independently. One shipment failing never fails the whole request. HTTP 400 is returned only when the request itself is invalid (missing/oversized/wrong-extension file, invalid `attachment_type_id`, empty or >250 ids, missing `Idempotency-Key` header). **Idempotency:** supply a unique `Idempotency-Key` header per logical upload attempt. Duplicate keys return HTTP 409.

Authentication

AuthorizationBearer

Authentication using Personal Access Token (PAT) token

OR
AuthorizationBearer
OAuth2 authentication using JWT tokens

Headers

Idempotency-KeystringRequired
Unique key for idempotent replay protection. Use a UUID per logical upload attempt.

Response

OK
summaryobject
Summary of the bulk operation results
resultslist of objects or nullOptional

Per-shipment results of the bulk operation

Errors

400
Bad Request Error
409
Conflict Error