webhook Webhook Events
Webhook event types and sample payloads
Unified Structure of Event Payload
Unified Webhook Events provide a standardized format for notifying subscribers about various occurrences or the resource changes within a system or platform. These events are designed to convey relevant information in a consistent manner, facilitating integration and automation processes.
Field Description | Optional | Data Type | Sample Data Value | |
---|---|---|---|---|
event_type | Webhook event type | X | string | invoice.created |
ref | The reference ID of the resource. This reference ID can be used for GoFreight REST APIs | 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. | O | object | {} |
Example:
{
"event_type": "webhook_event_type",
"ref": "reference_id",
"timestamp": 1691535792.22,
"__info": {}
}
Supported Webhook Event Types
Invoice Created Event
This event is triggered when an invoice is created.
{
"event_type": "invoice.created",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO."
}
}
Invoice Updated Event
This event is triggered when an invoice is updated.
{
"event_type": "invoice.updated",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO.",
"updated_fields": {
...
}
}
}
Invoice Deleted Event
This event is triggered when an invoice is deleted.
{
"event_type": "invoice.deleted",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO."
}
}
Invoice Blocked Event
This event is triggered when an invoice is blocked. For the definition of invoice block & unblock, please refer to the invoice block/unblock paragraph in the Terminology section.
{
"event_type": "invoice.blocked",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO."
}
}
Invoice Unblocked Event
This event is triggered when an invoice is unblocked. For the definition of invoice block & unblock, please refer to the invoice block/unblock paragraph in the Terminology section.
{
"event_type": "invoice.unblocked",
"ref": "invoice_ref",
"timestamp": 1691535792.22,
"__info": {
"invoice_no": "Invoice NO."
}
}
⚠️ (Deprecated) 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"
}
}
Payment Blocked Event
This event is triggered when a payment is blocked.
{
"event_type": "payment.blocked",
"ref": "payment_ref",
"timestamp": 1691535792.22
}
Payment Unblocked Event
This event is triggered when a payment is unblocked.
{
"event_type": "payment.unblocked",
"ref": "payment_ref",
"timestamp": 1691535792.22
}
Container Created Event
This event is triggered when a container is created.
{
"event_type": "container.created",
"ref": "container_ref",
"timestamp": 1691535792.22,
"__info": {
"container_no": "Container NO."
}
}
Container Updated Event
This event is triggered when a container is updated.
{
"event_type": "container.updated",
"ref": "container_ref",
"timestamp": 1691535792.22,
"__info": {
"container_no": "Container NO.",
"updated_fields": {
...
}
}
}
Container Deleted Event
This event is triggered when a container is deleted.
{
"event_type": "container.deleted",
"ref": "container_ref",
"timestamp": 1691535792.22,
"__info": {
"container_no": "Container NO."
}
}