Order attachments let you associate files with an order: invoices, CFDI (XML/PDF), shipping labels, delivery evidence, and more. Files are stored in S3 and accessed via short-lived presigned URLs — they never travel as base64 inside the API's JSON.
Response envelope
Every successful single-resource response follows { "data": {...} }. Errors are always { "error": { "code", "message", "details?" } }. Full catalog: Error Reference.
invoice, ticket, cfdi-xml, cfdi-pdf, shipping-guide, customs, receipt, other
evidence
packing-photo, packing-video, condition-photo
Don't confuse it with the old catalog
Values like cfdi, shipping_guide, or custom don't exist — the real catalog uses cfdi-xml/cfdi-pdf, shipping-guide (hyphenated), and other, respectively.
Returns the presigned S3 URL to upload the file (uploadUrl), the s3Key to use in the confirmation step, and the expiration time in seconds (expiresIn).
Returns the created attachment, nested under data.attachment. Its identifier is id — a server-generated UUID (randomUUID()), not a Mongo ObjectId (_id) — because attachments live as subdocuments inside the order's attachments array, not as their own collection. It also carries category (derived from type) and s3Key, which weren't in the request.
Returns the order's list of attachments (attachments) along with the total count (count). Each attachment is identified by id (UUID), not _id — same detail as the confirmation response.
Returns a presigned download URL (downloadUrl), the original filename (filename), and its expiration time in seconds (expiresIn) — all three fields are always present, filename is not optional.
Don't confuse it with the singular /attachment route
GET /orders/{orderId}/attachment (singular, no ID) is a legacy route registered on the router but it always responds 501 — it's a disabled stub left over from a migration, not a functional endpoint. Always use the plural route with {attachmentId} documented here.
This endpoint responds with 200 and { "data": { "success": true, "message": "..." } } — it is not a bodyless 204. Check data.success instead of relying solely on the status code.
Tip
Size and count limits are per category (document vs. evidence), not a single global limit — review the limits table above before uploading large evidence files.