Event payload structure
Every webhook delivery contains a JSON object with the following top-level fields:| Field | Type | Description |
|---|---|---|
event | string | The name of the event type. |
payload | object | The event-specific details. |
Declaration events
These events trigger during the customs lifecycle of a declaration.declaration.created
Occurs when you successfully create a new declaration.
Payload fields
| Field | Type | Description |
|---|---|---|
declarationId | number | The unique identifier of the declaration. |
lrn | string | The Local Reference Number. |
commercialReference | string | The Commercial Reference (UCR). |
statusCode | string | The status code of the declaration, initialized to new. |
createdAt | string | The date-time when the declaration was created. |
Example payload
declaration.status_updated
Occurs when the customs status of a declaration is updated.
Payload fields
| Field | Type | Description |
|---|---|---|
declarationId | number | The unique identifier of the declaration. |
status | string | The new status code value. See Declaration status codes for details. |
timestamp | string | The date-time when the status change occurred. |
Declaration status codes
Thestatus field contains one of the following values:
new— The declaration has just been created.readyToDeclare— The data is complete and ready to declare.prelodged— The advance declaration has been submitted.registered— The declaration has been registered with customs.presentation— The presentation notification has been sent.acknowledged— The declaration has been legally accepted.control— The declaration is under document or physical control.invalid— The declaration is invalid.blocked— The declaration has technical errors.released— The goods have been cleared by customs.norelease— The goods are not cleared.finalTaxNotice— The final customs tax decision is issued.completed— The customs process is finalized.canceled— The declaration is canceled.
Example payload
declaration.completed
Occurs when the customs clearance process is fully completed.
Payload fields
| Field | Type | Description |
|---|---|---|
declarationId | number | The unique identifier of the declaration. |
lrn | string | The Local Reference Number. |
mrn | string | The Master Reference Number issued by customs. |
statusCode | string | The status code of the declaration, which is completed. |
customsClearedAt | string | The date-time when customs cleared the declaration. |
completedAt | string | The date-time when the declaration was marked as completed. |
Example payload
declaration.invalidated
Occurs when a declaration is invalidated by customs.
Payload fields
| Field | Type | Description |
|---|---|---|
declarationId | number | The unique identifier of the declaration. |
lrn | string | The Local Reference Number. |
mrn | string | The Master Reference Number. |
statusCode | string | The status code of the declaration, which is invalid. |
invalidatedAt | string | The date-time when the declaration was invalidated. |
reason | string | The invalidation reason provided by customs. |
Example payload
declaration.error
Occurs when a declaration fails validation or receives an error from customs.
Payload fields
| Field | Type | Description |
|---|---|---|
declarationId | number | The unique identifier of the declaration. |
lrn | string | The Local Reference Number. |
errorType | string | The type of error (for example, INT_XML, CUSTOMS_XML, or CUSTOMS_ERR). |
errorMessage | string | The detailed description of the error. |
timestamp | string | The date-time when the error occurred. |
Example payload
Shipment events
These events trigger when you create or update shipments.shipment.created
Occurs when you successfully create a new shipment.
Payload fields
| Field | Type | Description |
|---|---|---|
shipmentId | number | The unique identifier of the shipment. |
shipmentNo | string | The shipment reference number. |
shipmentType | string | The shipment type: IMPORT or EXPORT. |
status | string | The shipment status, initialized to new. |
createdAt | string | The date-time when the shipment was created. |
Example payload
shipment.updated
Occurs when you update shipment details, such as weights, pricing, or status.
Payload fields
| Field | Type | Description |
|---|---|---|
shipmentId | number | The unique identifier of the shipment. |
shipmentNo | string | The shipment reference number. |
shipmentType | string | The shipment type: IMPORT or EXPORT. |
status | string | The current status of the shipment (new, clearanceInProgress, or completed). |
totalWeight | number | The total weight of the shipment. |
totalPrice | number | The total value/price of the shipment. |
updatedAt | string | The date-time when the shipment was last updated. |