Order events
Note
These events are for customers that have opted-in to the new modern Orders
API. For example, customers with access to Supplier Portal will have access to these order
event payloads. If you are an existing Shipwell customer and want to migrate to the new Orders (Beta)
API, contact your customer service representative. New customers typically start on the modern Orders framework and API. If you want to learn more as a new Shipwell customer contact sales here.
order.created
Example
{
"order_type":"PURCHASE_ORDER",
"resource_type":"order",
"custom_data":null,
"order_number":"MM-5676",
"ship_to":{
"timezone":"America/Chicago",
"country":"US",
"line_1":"9001 N Interstate Hwy 35",
"line_2":"Unit 110",
"line_3":null,
"locality":"Austin",
"postal_code":"78753",
"region":"TX",
"urbanization":null,
"residential":false,
"geolocation": {
"latitude": 30.3539143,
"longitude": -97.68906679999999
},
"location_number":"loc-123",
"company_name":"Final Destination Co.",
"references":[
{
"qualifier":"ADDRESS_BOOK_ENTRY_ID",
"value":"addr-123"
}
],
"shipping_requirements":{
"plan_window":null
},
"custom_data":null
},
"name":"Updated PO name",
"ship_from":{
"timezone":null,
"country":"US",
"line_1":"1234 8th St",
"line_2":null,
"line_3":null,
"locality":"Austin",
"postal_code":"78702",
"region":"TX",
"urbanization":null,
"residential":false,
"geolocation": {
"latitude": 10.0,
"longitude": 20.0
},
"location_number":"loc-456",
"company_name":"First Pickup Co.",
"references":[
{
"qualifier":"ADDRESS_BOOK_ENTRY_ID",
"value":"addr-456"
}
],
"shipping_requirements":{
"plan_window":{
"start":"2024-07-01T00:00:00+00:00",
"end":"2024-07-02T00:00:00+00:00"
}
},
"custom_data":null
},
"description":"Text description",
"source":"SHIPWELL_WEB",
"source_system_id":null,
"start_date":"2024-07-01T00:00:00+00:00",
"expiration_date":"2024-08-01T00:00:00+00:00",
"id":"0eb21d18-6c44-4865-a68e-db902e9e5e9c",
"status":"READY",
"items":[
],
"archived":false,
"references":[
{
"qualifier":"CUSTOMER_REFERENCE_NUMBER",
"value":"customer-ref-1"
},
{
"qualifier":"EXTERNAL_INVOICE_ID",
"value":"customer-ref-2"
}
],
"supplier":null,
"supplier_created_releases_allowed":true,
"created_from_order_id":null,
"released_from_release_id":null,
"releases":[
],
"cancelled_at":null
}
order.updated
Example
Note
The order.updated
event has two change tracking properties of old_data
and new_data
that contains the old and new values for data that has changed. The full current state of the order
may be obtained by making an API call to the self_link
in the event payload.
{
"id":"01HK5XC46G23VP5K9T03HP7DT1",
"order_type":"PURCHASE_ORDER",
"resource_type":"order",
"self_link":"/orders/01HK5XC46G23VP5K9T03HP7DT1",
"old_data":{
"ship_from":null
},
"new_data":{
"ship_from":{
"country":"US",
"line_1":"123 Shipwell Street",
"line_2":null,
"line_3":null,
"locality":"Austin",
"postal_code":"12345",
"region":"TX",
"urbanization":null,
"residential":false,
"geolocation":{
"latitude":10.0,
"longitude":20.0
},
"custom_data":null,
"timezone":null,
"location_number":null,
"company_name":null,
"references":[
],
"shipping_requirements":{
"plan_window":{
"start":"2024-07-01T00:00:00+00:00",
"end":"2024-07-02T00:00:00+00:00"
}
}
}
}
}
order.deleted
Note
Purchase orders are not deleted in the new modern Orders
API. Instead, purchase orders can transition to the canceled
state by performing the cancel
action, etc. which will produce ad order.updated
event.
order.item.updated
Example
Note
The order.item.updated
event has two change tracking properties of old_data
and new_data
that contains the old and new values for data that has changed. The full current state of the order item
may be obtained by making an API call to the self_link
in the event payload. To track updates to order items
, the order.item.updated
event must be subscribed to by the event/webhook recipient.
{
"old_data":{
"amount":{
"unit":"KG",
"value":"4000"
},
"shipping_requirements":{
"description":"Description of the item",
"customer_reference_number":"Customer specified reference",
"product_id":null,
"gross_weight":{
"unit":"KG",
"value":"4000"
},
"quantity":1,
"packaging_type":"PALLET"
}
},
"new_data":{
"amount":{
"unit":"LB",
"value":"200.00"
},
"shipping_requirements":{
"description":null,
"customer_reference_number":null,
"product_id":"8df4e14e-73d1-4194-8dd3-c0f76e693817",
"gross_weight":{
"unit":"LB",
"value":"120"
},
"quantity":20,
"packaging_type":"BIN"
}
},
"id":"01HGTT8Y5JV3YCXQ4ZH6Q43XKB",
"order_type": "PURCHASE_ORDER",
"resource_type":"order_item",
"self_link":"/orders/01HGTT8Y5DF6Z04DXWKWEXJM4D/items/01HGTT8Y5JV3YCXQ4ZH6Q43XKB",
"order_id":"01HGTT8Y5DF6Z04DXWKWEXJM4D"
}
order.item.deleted
Example
Note
The order.item.deleted
event is currently only emitted for purchase orders
(i.e. not sales orders
or other order types). If the order item
has custom data
(learn more here) then this will also be populated in the order.item.deleted
event else custom_data
will be set to null
. There is no self_link
populated on this event since the order_item
no longer exists on the order.
{
"id":"01HGTT8Y5JV3YCXQ4ZH6Q43XKB",
"order_type": "PURCHASE_ORDER",
"resource_type": "order_item",
"self_link": null,
"order_id":"01HGTT8Y5DF6Z04DXWKWEXJM4D",
"custom_data": {
"your_custom_data_key": "your_custom_data_value",
"shipwell_custom_data": {
"021e3e63-4c95-4b7d-86a9-e6de1a541ee9": "ABCD",
"b0bc76ac-5ddb-4dc6-89cf-fd7a4511a4b1": "Line 004"
}
},
"description": "Description of the item",
"references": [],
"amount": {
"value": "4000",
"unit": "KG"
},
"available_amount": {
"value": "4000",
"unit": "KG"
},
"shipping_requirements": {
"description": "Description of the item",
"identifying_marks": [],
"references": [],
"tare_weight": null,
"dimensions": null,
"volume": null,
"customer_reference_number": "Customer specified reference",
"hazmat": null,
"temperature": null,
"product_id": null,
"freight_class": null,
"nmfc_item_code": null,
"nmfc_sub_code": null,
"country_of_manufacture": null,
"stackable": false,
"piece_type": null,
"total_pieces": null,
"value_per_piece": null,
"gross_weight": {"unit": "KG", "value": "4000"},
"quantity": "1",
"packaging_type": "PALLET",
"handling_unit_id": null,
"combined_handling_unit_info": null
}
}