webhook Webhook Events
Webhook event types and sample payloads
Event Payload Envelope
Every current webhook event is delivered as a JSON object carrying event_type, ref and timestamp, plus an optional __info object holding resource details.
__info is omitted entirely for events that carry no resource details — it is not sent as an empty object. Read it defensively (payload.get("__info", {}) rather than payload["__info"]); the index table marks which events include it.
The deprecated INVOICE_BLOCK_STATUS_UPDATED event predates this envelope and uses a different, legacy shape.
In every table on this page, the Optional column reads X = always present, O = not present on every event (the Description says which events carry it). A field that is present can still be null.
| Field Description | Optional | Data Type | Sample Data Value | |
|---|---|---|---|---|
event_type | Webhook event type | X | string | invoice.created |
ref | The identifier of the resource — usually a reference ID usable with the GoFreight REST APIs. Some resources use a different identifier: trade partner events send the trade partner code. The index table below gives the identifier for each event. | X | string | 1002 |
timestamp | Webhook event timestamp | X | number | 1691535792.22 |
__info | The additional information of the event. Please note that we do not guarantee its backward compatibility. Omitted entirely on events that carry no resource details. | O | object | {"invoice_no": "Invoice NO."} |
{
"event_type": "invoice.created",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO."
}
}Supported Webhook Event Types
The table below lists the webhook event types GoFreight emits. Use the event_type string verbatim in the event_types array when you register a subscription.
The __info column links to the field definitions for that resource. — means the event carries no __info.
event_type | ref | __info | Description |
|---|---|---|---|
oi_mbl.created | MB/L ref | — | Ocean import MB/L created |
oi_mbl.updated | MB/L ref | — | Ocean import MB/L updated |
oi_mbl.deleted | MB/L ref | — | Ocean import MB/L deleted |
oi_hbl.created | HB/L ref | — | Ocean import HB/L created |
oi_hbl.updated | HB/L ref | — | Ocean import HB/L updated |
oi_hbl.deleted | HB/L ref | — | Ocean import HB/L deleted |
oe_mbl.created | MB/L ref | — | Ocean export MB/L created |
oe_mbl.updated | MB/L ref | — | Ocean export MB/L updated |
oe_mbl.deleted | MB/L ref | — | Ocean export MB/L deleted |
oe_hbl.created | HB/L ref | — | Ocean export HB/L created |
oe_hbl.updated | HB/L ref | — | Ocean export HB/L updated |
oe_hbl.deleted | HB/L ref | — | Ocean export HB/L deleted |
invoice.created | Invoice ref | Invoice | Invoice created |
invoice.updated | Invoice ref | Invoice, updated_fields | Invoice updated |
invoice.deleted | Invoice ref | Invoice | Invoice deleted |
invoice.blocked | Invoice ref | Invoice | Invoice blocked |
invoice.unblocked | Invoice ref | Invoice | Invoice unblocked |
invoice.voided | Invoice ref | Invoice, is_void, void_date | Invoice voided |
payment.created | Payment ref | — | Payment created |
payment.updated | Payment ref | — | Payment updated |
payment.deleted | Payment ref | — | Payment deleted |
payment.blocked | Payment ref | — | Payment blocked |
payment.unblocked | Payment ref | — | Payment unblocked |
container.created | Container ref | Container | Container created |
container.updated | Container ref | Container, updated_fields | Container updated |
container.deleted | Container ref | Container | Container deleted |
trade_partner.created | TP code | Trade partner | Trade partner created |
trade_partner.updated | TP code | Trade partner, updated_fields | Trade partner updated |
trade_partner.merged | TP code | Trade partner, merged_from_code, merged_from_name | Another trade partner merged into this one |
trade_partner.deleted | TP code | Trade partner | Trade partner deleted |
billing_code.created | Billing code ref | Billing code | Billing code created |
billing_code.updated | Billing code ref | Billing code, updated_fields | Billing code updated |
general_ledger_code.created | G/L code ref | G/L code | General ledger code created |
general_ledger_code.updated | G/L code ref | G/L code, updated_fields | General ledger code updated |
updated_fields appears only on the *.updated events whose __info table below defines it: invoice.updated, container.updated, trade_partner.updated, billing_code.updated and general_ledger_code.updated. The ocean B/L updates and payment.updated carry no __info at all. Where it does appear, its type is always string[], possibly null. Note that the naming is not uniform across resources: trade partner, billing code and G/L code events report public API field names, dot-notated for nested fields (e.g. address.country, general_ledgers.revenue), while invoice and container report names that may not match the corresponding REST API fields — match on them defensively. trade_partner.updated additionally appends the derived address.print_address and address.billing_address whenever any field feeding the printed address changes; these two describe a recomputed value rather than a single field you set. The per-resource tables below list the values you can expect.Event Payload Details
Each section below covers one resource: the __info fields its events carry, plus an example payload. Every event also carries the envelope fields event_type, ref and timestamp; where a resource has no __info, the example shows the envelope alone.
Optional column: X = always present, O = not present on every event of this resource — the Description names the events that carry it. A present field can still be null.
Ocean B/L Events
oi_mbl.*, oi_hbl.*, oe_mbl.*, oe_hbl.* carry no __info. ref is the MB/L or HB/L reference ID.
{
"event_type": "oi_mbl.created",
"ref": "mbl_ref",
"timestamp": 1706337141.0
}Invoice Events
__info field | Optional | Data Type | Description |
|---|---|---|---|
invoice_no | X | string | The invoice number |
updated_fields | O | string[] | null | invoice.updated only. Names of the invoice fields that changed |
is_void | O | boolean | invoice.voided only. Always present on that event. Void state of the invoice |
void_date | O | string | null | invoice.voided only. Always present on that event. ISO 8601 date (YYYY-MM-DD), or null when the void date is not available |
{
"event_type": "invoice.voided",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO.",
"is_void": true,
"void_date": "2024-04-12"
}
}Payment Events
payment.* events carry no __info. ref is the payment reference ID.
{
"event_type": "payment.created",
"ref": "payment_ref",
"timestamp": 1691535792.22
}Container Events
__info field | Optional | Data Type | Description |
|---|---|---|---|
container_no | X | string | The container number |
updated_fields | O | string[] | null | container.updated only. Names of the container fields that changed |
{
"event_type": "container.updated",
"ref": "container_ref",
"timestamp": 1691535792.22,
"__info": {
"container_no": "Container NO.",
"updated_fields": ["field_name"]
}
}Trade Partner Events
For trade partner events, ref is the trade partner code, not a numeric reference ID.
updated_fields reports public API field names rather than the raw names those fields are stored under — an office change is reported as office, and address fields are dot-notated (address.country, address.phone, address.zip_code). When any field feeding the printed address changes, the derived address.print_address and address.billing_address are appended as well.
__info field | Optional | Data Type | Description |
|---|---|---|---|
readable_name | X | string | The trade partner name |
updated_fields | O | string[] | null | trade_partner.updated only. Public API field names of what changed, dot-notated for nested fields (e.g. office, address.country, address.zip_code) |
merged_from_code | O | string | trade_partner.merged only. Always present on that event. Code of the trade partner that was merged into ref |
merged_from_name | O | string | trade_partner.merged only. Always present on that event. Name of the trade partner that was merged into ref |
{
"event_type": "trade_partner.merged",
"ref": "TP code 1",
"timestamp": 1691535792.22,
"__info": {
"readable_name": "TP Name 1",
"merged_from_code": "TP code 2",
"merged_from_name": "TP Name 2"
}
}Billing Code Events
__info field | Optional | Data Type | Description |
|---|---|---|---|
readable_name | X | string | The billing code |
updated_fields | O | string[] | null | billing_code.updated only. A subset of code, name, local_name, is_active, general_ledgers.revenue, general_ledgers.cost, general_ledgers.credit, general_ledgers.debit |
{
"event_type": "billing_code.updated",
"ref": "billing_code_ref",
"timestamp": 1691535792.22,
"__info": {
"readable_name": "code",
"updated_fields": ["name", "general_ledgers.revenue"]
}
}General Ledger Code Events
__info field | Optional | Data Type | Description |
|---|---|---|---|
readable_name | X | string | The G/L code |
updated_fields | O | string[] | null | general_ledger_code.updated only. A subset of code, type, group_type, is_active |
{
"event_type": "general_ledger_code.updated",
"ref": "general_ledger_code_ref",
"timestamp": 1691535792.22,
"__info": {
"readable_name": "code",
"updated_fields": ["code", "is_active"]
}
}Deprecated Events
⚠️ Invoice Block Status Updated Event
invoice.blocked & invoice.unblocked instead.Click here for the details.
This event is triggered when an invoice is either blocked or unblocked. For the definition of invoice block & unblock, please refer to the invoice block/unblock paragraph in the Terminology section.
{
"event_type": "INVOICE_BLOCK_STATUS_UPDATED",
"timestamp": 1691535792.22,
"invoice": {
"ref": "invoice_ref",
"invoice_no": "invoice_no",
"system_no": "system_no",
"customer_ref_no": "customer_ref_no",
"type": "S",
"amount": "123.23",
"paid_amount": "0",
"tax_amount": "10.00",
"process_state": "N",
"post_date": "2023-07-31T20:35:03",
"due_date": "2023-08-01T20:35:03",
"is_block": true,
"block_by": {
"ref": 3,
"username": "block by username"
},
"block_date": "2023-08-22",
"is_general_expense": false,
"remark": "some description",
"lines": [
{
"ref": 54140,
"name": "ISF FILING FEE",
"type": "B",
"freight_term": "C",
"unit": "UNT",
"link_type": "AP-OC",
"currency": {
"ref": 1,
"name": "USD"
},
"currency_amount": "123.23",
"volume": "12",
"rate": "28.27",
"amount": "339.24",
"billing_code": {
"ref": 121,
"code": "OI07ISF",
"name": "ISF FILING FEE",
"general_ledger_code": {
"ref": 157,
"code": "45406",
"type": "CO"
}
},
"tax": {
"name": "tax_name",
"type": "S",
"rate": "10.0"
}
}
]
},
"creator": {
"ref": "user_ref",
"username": "user name",
"email": "user email"
},
"trade_partner": {
"ref": "tp_ref",
"type": "CS",
"name": "tp name",
"local_name": "tp local name",
"short_name": "tp short name"
},
"mbl": {
"ref": "mbl_ref",
"transportation_mode": "OI",
"mbl_no": "mbl no"
},
"hbl": {
"ref": "new_hbl_ref",
"transportation_mode": "OI",
"hbl_no": "hbl no"
},
"office": {
"ref": "office_ref",
"short_name": "office short name",
"full_name": "office full name",
"local_name": "office local name"
}
}