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.Documentation Index
Fetch the complete documentation index at: https://terminal49-wayfair-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Coming Soon
email_submission.createdevent: 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:Terminal49 account access
Confirm you can log in and switch between the test and production accounts (see Environments below).
API key
Generate an API key from User > Developers > API Keys. You’ll need this to register your webhook and call the API.
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.
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:| Environment | Account name |
|---|---|
| Test | Wayfair Development (Castlegate Logistics) |
| Production | Wayfair LLC |
Authentication
All API calls require an API key passed as a Bearer token:Subscribing to Events
Register a webhook endpoint to receive document processing notifications:- Click your username in the bottom-left corner of the navigation.
- Go to User > Developers > Webhooks.
- To add a new endpoint, click Create Webhook, fill in your URL, and select the relevant events under Document Events.
- 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 HTTP200, 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:
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
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
| Environment | Email address |
|---|---|
| Test | wayfair-development-castlegate-logistics-60@docs.terminal49.com |
| Production | wayfair-llc-96@docs.terminal49.com |
email_submission.Unsupported files: Encrypted or password-protected files cannot be processed and will result in a document_representation.failed event.Terminal49 processes document
Terminal49 classifies and extracts structured data asynchronously. Processing typically completes within seconds to a few minutes depending on document complexity.
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
Adocument_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.
| Event | Meaning | Signal |
|---|---|---|
document_representation.created | Extraction completed successfully | document_type is set; payload contains extracted fields |
document_representation.failed | Extraction did not complete | document_type is "unknown"; last_document_representation is null |
Webhook Payload Structure
Every document webhook follows the same envelope structure. Thepayload 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:
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 thefile_url from the webhook has expired, request a new one:
{id} with the document id from the webhook payload. Response:
Schema versioning
Every webhook payload includes aschema_version field that identifies the document type and the schema date in use:
- 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.
schema_version to route your parsing logic. If you support multiple versions, branch on this field.
Persisting extracted data
Use thedocument_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 receivedocument_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 Types in Scope
The table below maps Wayfair’s document type names to thedocument_type values returned by the API, along with the actual source documents Terminal49 may receive and classify into each type.
| Wayfair Document Type | document_type value | Observed Documents | Notes |
|---|---|---|---|
| Draft House Bill of Lading | draft_house_bill_of_lading | House Bill of Lading | hbl_type: "DRAFT" in payload |
| Final House Bill of Lading | final_house_bill_of_lading | House Bill of Lading | hbl_type: "TELEX" in payload |
| Importer Security Filing | importer_security_filing | Importer Security Filing | |
| Master Bill of Lading | master_bill_of_lading | Sea Waybill | |
| Dray Delivery Order | dray_delivery_order | Delivery Order (Castlegate variant), Delivery Order (Non-Castlegate variant) | Both variants map to the same document_type |
| ARC | One of: arrival_notice, general_notice, customs_entry, other etc. | Arrival Notice, General Notice, Container Available Notice, In Bond, Freight Invoice | Wayfair uses “ARC” as an umbrella label, but these are distinct document types. Mapping is: Arrival Notice → arrival_notice; General Notice / Container Available Notice → general_notice; In Bond → customs_entry; Freight Invoice → other (in Wayfair schema). |
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.