Skip to main content
Shipping documents (House Bills of Lading, Master Bills of Lading, arrival notices, delivery orders, and more) arrive in shared inboxes and have traditionally required manual classification, data entry, and filing. This integration automates that workflow: Terminal49 receives each document by email, classifies it, extracts structured fields, and delivers the results to your system via webhook. The outcome is less manual re-keying, faster time-to-file, and fewer errors from misfiled or delayed documents, freeing your team from routine data entry to focus on true exceptions. Submit documents by emailing attachments to your account docs alias. Terminal49 then handles the rest: classify -> extract -> webhook result.

Coming Soon

  • email_submission.created event: a webhook fired immediately on email receipt, before classification and extraction complete.
  • Action required flow: documentation in progress.

Before You Start

Make sure you have the following in place before building:
1

Terminal49 account access

Confirm you can log in and switch between the test and production accounts (see Environments below).
2

API key

Generate an API key from User > Developers > API Keys. You’ll need this to register your webhook and call the API.
3

A publicly accessible HTTPS endpoint

Your server needs a reachable HTTPS URL to receive webhook POST requests from Terminal49. For local development, use a tool like ngrok to expose a local port.
4

Webhook subscription

Register your endpoint and subscribe to document_representation.created and document_representation.failed (see Subscribing to Events below).

Environments

Your Terminal49 account has two environments, both accessible from the account switcher in the top-left corner when you log in:
Both environments make live calls. Documents submitted under either account are processed and costs will be incurred. There is no free sandbox for document processing at this time.

Authentication

All API calls require an API key passed as a Bearer token:
To get your API key, go to User > Developers > API Keys (click your username in the bottom-left corner of the navigation). For more detail, see Start Here.

Subscribing to Events

Register a webhook endpoint to receive document processing notifications:
You can also configure webhooks from the Terminal49 dashboard:
  1. Click your username in the bottom-left corner of the navigation.
  2. Go to User > Developers > Webhooks.
  3. To add a new endpoint, click Create Webhook, fill in your URL, and select the relevant events under Document Events.
  4. To update an existing endpoint, click into it and toggle on the document events you need.

Webhook Endpoint Requirements

Your endpoint must meet the following requirements to reliably receive webhook notifications: Response codes: Return HTTP 200, 201, 202, or 204. Any other response (including a timeout) is treated as a delivery failure and will trigger retries. Retries: Terminal49 will retry failed deliveries multiple times. Design your endpoint to be idempotent. Use data.id (the webhook_notification UUID) as your idempotency key to avoid processing the same event twice. HTTPS: Your endpoint must be accessible over HTTPS. IP allowlist: Webhook notifications are sent from the following IP addresses. Allowlist these if your infrastructure restricts inbound traffic:
Signature verification (recommended): Each webhook is signed using HMAC SHA-256. The signature is included in the X-T49-Webhook-Signature header. To verify, retrieve the secret from your webhook configuration and compute the HMAC digest of the raw request body; it should match the header value.

Workflow Diagrams

Workflow: Step-by-Step

1

Submit document

Email attachments to your account docs alias:Supported file types: PDF, PNG, JPEG, XLSX, XLS, CSV, Word (.doc, .docx).Multiple attachments: Each attachment in a single email is processed independently and generates its own webhook event. All resulting webhooks reference the same email_submission.Unsupported files: Encrypted or password-protected files cannot be processed and will result in a document_representation.failed event.
2

Terminal49 processes document

Terminal49 classifies and extracts structured data asynchronously. Processing typically completes within seconds to a few minutes depending on document complexity.
3

Receive webhook result

You receive document_representation.created (extraction succeeded) or document_representation.failed (extraction could not complete). Parse the payload, route by document_type, store the extracted fields, and trigger your downstream processes.
Treat submission as fire-and-forget. Do not poll or wait for a response after sending the email. The webhook is the signal that processing is complete.
If the same file content has already been processed for your account, it is treated as a duplicate and ignored. No webhook is fired.

Webhooks You Should Handle

A document_representation is the structured extraction result for a document. document_representation.created means extraction succeeded and structured data is available in the payload. document_representation.failed means Terminal49 could not produce an extraction result.

Webhook Payload Structure

Every document webhook follows the same envelope structure. The payload object inside document_representation contains the extracted fields and varies by document type. See Document Types in Scope for full examples. document_representation.created envelope:
When the webhook document is a child document (split from a larger packet), the document include also contains attributes.parsed.packetSegment and a parent_document relationship:
file_url is a pre-signed S3 URL and expires after 1 hour. Download the file promptly after receiving the webhook, or fetch a fresh URL using the endpoint below.

Fetching a fresh download URL

If the file_url from the webhook has expired, request a new one:
Replace {id} with the document id from the webhook payload. Response:

Schema versioning

Every webhook payload includes a schema_version field that identifies the document type and the schema date in use:
Your account is pinned to a specific schema date. All document types will use the latest schema version up to and including that date. Terminal49 can update your pinned version when you are ready to migrate. What changes the version:
  • Breaking changes (fields removed, renamed, or restructured) increment the date. Terminal49 will either support parallel versions during a migration window or coordinate a cutover date with you.
  • Non-breaking additions (new optional fields) do not change the version.
Use schema_version to route your parsing logic. If you support multiple versions, branch on this field.

Persisting extracted data

Use the document_type and schema_version to look up the expected payload fields for that document type, then store the extracted data in your system.

Handling a failed extraction

If extraction fails, you will receive document_representation.failed instead. The key signal is "document_type": "unknown" means the document was received but could not be classified or extracted. There is no document_representation in included and last_document_representation will be null.
document_type: "unknown" means Terminal49 could not classify or extract the document. Log the document id and file_url for investigation. If failures recur on the same document type, contact Terminal49 support.

Document Types in Scope

The table below maps Wayfair’s document type names to the document_type values returned by the API, along with the actual source documents Terminal49 may receive and classify into each type. Additional document types will be added in future phases.
Null fields are intentional. A null value means Terminal49 looked for that field in the source document but did not find it. Treat null as “checked, not present” rather than “field not supported” or “not checked”.

Draft House Bill of Lading: Full Webhook Payload

schema_version: draft_house_bill_of_lading@2026-03-23

Final House Bill of Lading: Full Webhook Payload

schema_version: final_house_bill_of_lading@2026-03-23

ISF (Importer Security Filing): Full Webhook Payload

schema_version: importer_security_filing@2026-03-30

Master Bill of Lading: Full Webhook Payload

schema_version: master_bill_of_lading@2026-03-23

Delivery Order: Full Webhook Payload

schema_version: dray_delivery_order@2026-03-30

Use these endpoints while integrating

For Wayfair document webhook events, you can trigger a test payload for a specific document type without sending an email:
Webhook event availability depends on your account configuration. If you are not receiving expected events, contact Terminal49 support.

APIs Involved