---
title: "Register a document for a label"
method: POST
path: "/v1/labels/{label_id}/documents"
tags: ["documents"]
---

# Register a document for a label

`POST /v1/labels/{label_id}/documents`

Register a carrier document against a label. The response returns an `upload` target; upload the document file to that target, then call the send documents endpoint to transmit it to the carrier. Carrier information is resolved automatically from the label.

## Request body

- RegisterDocumentRequestBody — A request to register a carrier document against a shipment or label.
  - `type` 'commercial_invoice' | 'certificate_of_origin' | 'usmca_commercial_invoice_certification_of_origin' | 'usmca_certification_of_origin' | 'pro_forma_invoice' | 'other' | 'authorization_form' | 'export_accompanying_document' | 'export_license' | 'import_permit' | 'one_time_nafta' | 'power_of_attorney' | 'packing_list' | 'sed_document' | 'shippers_letter_of_instruction' | 'declaration' | 'section_232_customs_affidavit', required — The type of carrier document being registered. Supported values vary by carrier. See the [Carrier Document Upload guide](/apis/@shipengine/docs/labels/carrier-document-upload.md) for the document types each carrier accepts.
  - `format` 'PDF' | 'PNG' — The file format of the document being uploaded.
  - `file_name` string, required — The file name of the document, including its extension.

## Response `200`

The document was registered successfully.

- RegisterDocumentResponseBody — The result of registering a document. Use the returned `upload` target to upload the document file to Amazon S3 before sending it to the carrier.
  - `document_id` string — The unique identifier assigned to the registered document.
  - `upload` DocumentUploadTarget — A pre-signed Amazon S3 POST target describing where and how to upload a document file.
    - `url` string, uri — The Amazon S3 endpoint to upload the document file to via an HTTP `POST` with `multipart/form-data`.
    - `fields` object — The S3 presigned-POST form fields. Include **every** field exactly as returned in the upload request, followed by a `file` part containing the document content.
      - `Content-Type` string — The MIME type of the document; matches the registered document format.
      - `key` string — The S3 object key the file will be stored under.
      - `x-amz-meta-document-id` string — S3 object metadata: the registered document's unique identifier.
      - `x-amz-meta-seller-id` string — S3 object metadata: the seller's identifier.
      - `X-Amz-Algorithm` string — The AWS signing algorithm used for the pre-signed POST.
      - `X-Amz-Credential` string — The AWS credential scope used to sign the upload.
      - `X-Amz-Date` string — The timestamp the signature was generated, in ISO 8601 basic format.
      - `Policy` string — The base64-encoded S3 POST policy defining the conditions the upload must satisfy, such as the allowed key, content type, size, and expiration.
      - `X-Amz-Signature` string — The signature authorizing the upload, derived from the policy and credentials.
      - `X-Amz-Security-Token` string — The temporary AWS session token for the credentials.

## Other responses

- `400` — The request contained errors.
- `404` — The specified resource does not exist.
- `500` — An error occurred on ShipEngine's side. > This error will automatically be reported to our engineers.

---

[API](https://skmtc.net/shipstation/apis/shipengine-api.md) · [All operations](https://skmtc.net/shipstation/apis/shipengine-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shipstation/shipengine-api/revisions/8d8a7cf79204/schema)
