---
title: "Register a document for a shipment"
method: POST
path: "/v2/shipments/{shipment_id}/documents"
tags: ["documents"]
---

# Register a document for a shipment

`POST /v2/shipments/{shipment_id}/documents`

<aside class="access" aria-label="Endpoint access">
      <table class="access__table">
        <thead>
          <tr>
            <th class="access__table-header">Products</th>
            <th class="access__table-header">Plans</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="access__table-cell access__product">
              <img class="access__logo" src="/static/logos/shipstation-api-logo.svg" alt="ShipStation API Logo" loading="lazy" decoding="async"/>
              <div class="access__sub">Formerly ShipEngine</div>
            </td>
            <td class="access__table-cell access__plans">
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-api-free.md" class="access__plan">Free</a>
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-api-advanced-enterprise.md" class="access__plan">Advanced</a>
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-api-advanced-enterprise.md" class="access__plan">Enterprise</a>
            </td>
          </tr>
          <tr>
            <td class="access__table-cell">
              <img class="access__logo" src="/static/logos/shipstation-logo.svg" alt="ShipStation Logo" loading="lazy" decoding="async"/>
            </td>
            <td class="access__table-cell access__plans">
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-free-starter.md" class="access__plan access__plan--off">Free</a>
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-free-starter.md" class="access__plan access__plan--off">Starter</a>
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-standard-premium.md" class="access__plan access__plan--off">Standard</a>
              <a href="/apis/@shipstation-v2/docs/getting-started/plans/shipstation-standard-premium.md" class="access__plan access__plan--off">Premium</a>
            </td>
          </tr>
        </tbody>
      </table>
      <footer class="access__footer">
        <a class="access__help" href="/apis/@shipstation-v2/docs/getting-started/products-and-plans.md">
          Learn about products and plans
          <img src="/static/icons/external-link.svg" alt="External Link Icon" style="width: 16px;" loading="lazy" decoding="async"/>
        </a>
      </footer>
    </aside>

Register a carrier document against a shipment. The response returns an `upload` target; upload the document file to that target so it can later be sent to the carrier.

## 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](/upload-carrier-documents) 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` — The request was successful.

---

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