Order Events
Order event types, what triggers each one, and the fields its payload carries
These events fire on the order object. To receive them, register the order.* pattern — or any individual event below — against a webhook target. See Configure Webhooks via API for how to create a target and define filters.
Event types
| Event | Description |
|---|---|
order.create | Triggered when a new order is created. This event fires when the first product line item is added to the order, marking the creation of the order record. |
order.change_shipping_address | Triggered when an order’s shipping address is set. This event can be triggered more than once for an order. |
order.change_payment | Triggered when an order’s payment is set. This event can be triggered more than once for an order. |
order.change_billing | — |
order.change_next_order_date | Triggered when an order’s desired placement date is modified. This event can be triggered more than once for an order. This event is not triggered when creation is from your Ordergroove Admin. |
order.skip_order | Triggered when an order is cancelled, meaning the order will not be placed. This event will only occur once for an order. |
order.send_now | Triggered when an order’s placement date was moved up to today. The order will be placed as soon as possible. |
order.cancel | Triggered when the placement response (response code “030”) for an order indicates it should be cancelled and no longer attempted. This event will only occur once for an order. |
order.success | Triggered when the placement response for an order indicates it was processed successfully and GMV was realized. This event will only occur once for an order. |
order.delete | Triggered when an order is deleted. The webhook payload should be used solely to mark orders in your system as deleted. Fields like total, sub_total, and tax_total represent a snapshot from when the order was deleted. They do not reflect the “current reality” of the order (for example, totals as “0”), since deleted orders no longer include their items. |
order.generic_error | Triggered when the placement response for an order indicates an unknown error occurred (response code “999”) and should be retried. This event can be triggered more than once for an order. |
order.reject | Triggered when the placement response for an order indicates the order was rejected, no GMV was realized, and the order should not be retried. This event will only occur once for an order. |
order.reminder | Triggered when a reminder notification is sent to a customer for an upcoming order that will be placed (usually within the next few days). This event can be triggered more than once for an order, but generally occurs only once. |
order.retryable_placement_failure | Triggered when the placement response for an order indicates it should be processed through our configurable retry flow. This event can be triggered more than once for an order and will only occur if your program is configured to use this feature. |
order.refresh_one_click_token | Triggered when the previous 1-Click token is used. |
order.credit_card_expiration_warning | Triggered twice a month (on the 1st and 15th) for customers who have a scheduled order in the upcoming month, but whose credit card is set to expire before that order runs. |
order.* | Matches every event in this family. |
Payload
| Name | Type | Description | Example |
|---|---|---|---|
id | str | Identifier of the event | ”mmmm4444nnnn3333pppp” |
type | str | The type of event that occurred | See below for full list of event types |
created | int | Time since epoch when the event occurred | 1622589211 |
data | object | Event data object | See JSON below |
data.object.type | str | Resource type of event | ”order” |
data.object.merchant | str | Identifier of merchant | ”aaaa1111bbbb2222cccc” |
data.object.public_id | str | Public ID of resource. Should be used to retrieve additional resource object data via OG API if necessary. | ”zzzz9999yyyy8888xxxx” |
data.object.customer | str | The merchant_user_id — the ID from the merchant system, not our internal public ID | ”h183738” |
data.object.payment | str | Payment record ID | ”a748aa648ac811e8af3bbc764e106cf4” |
data.object.shipping_address | str | Shipping address record ID | ”66c25cd0564011e9abc5bc764e107990” |
data.object.sub_total | str | Subtotal of items in order | ”20.00” |
data.object.tax_total | str | Tax applied to order | ”5.00” |
data.object.shipping_total | str | Shipping cost applied to order | ”0.00” |
data.object.discount_total | str | Discount applied to order | ”0.00” |
data.object.total | str | Total price of order | ”25.00” |
data.object.created | int | Unix timestamp when the order was created | 1300375961 |
data.object.place | str | Date for order placement. Format: “YYYY-MM-DD" | "2021-05-01” |
data.object.cancelled | str | Unix timestamp when the order was cancelled | 1300375961 |
data.object.tries | int | Number of attempts to place the order | 0 |
data.object.generic_error_count | int | Number of times your system returned a generic error response (“999”) when we attempted to place the order | 0 |
data.object.status | int | Status enum | 1 |
data.object.status_display | str | Readable version of status enum | ”Unsent” |
data.object.order_merchant_id | str | Order ID in your system after we have placed an order and you respond that it was processed successfully | ”ABC123” |
data.object.rejected_message | str | Message your system provides when you respond with “REJECT” to an order we attempt to place. Format depends on your responses — we store the string as provided. | ”Expiration Date is in the past” |
data.object.extra_data | object | Key/value store for any extra information | |
data.object.one_click_token | str | 1-Click action token. Only passed on order.reminder and order.refresh_one_click_token events. The action token must be enabled for your merchant account; see Using Webhooks for 1-Click Actions. | ”eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudCI6IjAxZm” |
Example Data
{"id": "mmmm4444nnnn3333pppp","type": "order.success","created": 1622589211,"data": {"object": {"type": "order","merchant": "aaaa1111bbbb2222cccc","public_id": "zzzz9999yyyy8888xxxx","customer": "m1234576","payment": "a748aa648ac811e8af3bbc764e106cf4","shipping_address": "66c25cd0564011e9abc5bc764e107990","discount_total": "0.00","shipping_total": "0.00","sub_total": "0.00","tax_total": "0.00","total": "0.00","extra_data": {},"generic_error_count": 0,"order_merchant_id": null,"place": "2021-04-06","rejected_message": null,"status": 1,"status_display": "Unsent","tries": 0,"cancelled": null,"created": 1301093861}}}