Subscription Events

Subscription event types, what triggers each one, and the fields its payload carries
View as Markdown

These events fire on the subscription object. To receive them, register the subscription.* 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

EventDescription
subscription.createTriggered whenever the customer creates a subscription. This event can only be triggered once for a subscription. This event is not triggered when creation is from your Ordergroove Admin.
subscription.cancelTriggered whenever a subscription is cancelled. This event can be triggered more than once for a subscription.
subscription.sku_swapTriggered when the product associated with a subscription is changed. This event can be triggered more than once for a subscription.
subscription.reactivate—
subscription.change_frequencyTriggered when the subscription’s delivery frequency is modified. This event can be triggered more than once for a subscription.
subscription.change_componentsFor subscriptions associated with bundles, this is triggered when a product is updated, added, or removed from the list of bundle components of the subscription. This event can be triggered more than once for a subscription.
subscription.change_quantityTriggered when the subscription’s quantity is modified. This event can be triggered more than once for a subscription.
subscription.change_shipping_addressTriggered when a subscription’s shipping address is set. This event can be triggered more than once for a subscription.
subscription.change_paymentTriggered when a subscription’s payment is set. This event can be triggered more than once for a subscription.
subscription.change_liveTriggered when a cancelled subscription is reactivated. This event can be triggered more than once for a subscription.
subscription.*Matches every event in this family.

Payload

NameTypeDescriptionExample
idstrIdentifier of the event”mmmm4444nnnn3333pppp”
typestrThe type of event that occurredSee below for full list of event types
createdintTime since epoch when the event occurred1622589211
dataobjectEvent data objectSee JSON below
data.object.typestrResource type of event”Subscription”
data.object.merchantstrIdentifier of merchant”aaaa1111bbbb2222cccc”
data.object.public_idstrPublic ID of resource. Should be used to retrieve additional resource object data via OG API if necessary.”zzzz9999yyyy8888xxxx”
data.object.customerstrThe merchant_user_id — the ID from the merchant system, not our internal public ID”h183738”
data.object.productstrThe external product ID from the merchant’s system”SKUabc”
data.object.componentsarrayList of objects representing the bundle components/products[{"product": "product_1", "public_id": "...", "quantity": 1}]
data.object.prepaid_subscription_contextobjectPrepaid information returned only if prepaid is enabled{"prepaid_orders_remaining": 0, "prepaid_orders_per_billing": 3, "renewal_behavior": "autorenew", ...} or null
data.object.extra_dataobjectKey/value store for any extra information{"some": "extra", "fields": "here"}
data.object.quantityintNumber of items1
data.object.pricestrPrice of the subscription when leveraging price lock feature”12.99”
data.object.frequency_daysintOrder placement interval in days30
data.object.reminder_daysintDays before order placement to send email reminder (minimum of 5)5
data.object.everyintNumber of periods1
data.object.every_periodintType of period enum. Options: 1, 2, 33
data.object.every_period_displaystrReadable version of period enum. Options: “Days”, “Weeks”, “Months""Months”
data.object.cancelledintUnix timestamp of when the subscription was cancelled, if no longer active1301325188
data.object.cancel_reasonstrPipe-delimited cancel reason code and cancel reason details”4|Overstocked”
data.object.cancel_reason_codeintCode ID of the cancel reason4
data.object.session_idstrSession ID, obtained from og_session_id cookie”aaaa1111bbbb2222cccc.450125.1299622365”
data.object.merchant_order_idstrOrder ID in your system, corresponding to the checkout that created the subscription”12345678”
data.object.liveboolWhether the subscription is active. true means the customer wants to continue receiving the product; false means they do not.true
data.object.external_idstrExternal representation of the subscription in your system. For Shopify integrations, this is the Shopify contract ID.”external-identifier”
data.object.createdintUnix timestamp when the subscription was created1300375961
data.object.start_datestrDate the subscription started. Format: “YYYY-MM-DD""2021-03-25”
data.object.offerstrOffer record ID”a748aa648ac811e8af3bbc764e106cf4”
data.object.paymentstrPayment record ID”070001bc02fd11e99542bc764e1043b0”
data.object.shipping_addressstrShipping address record ID”66c25cd0564011e9abc5bc764e107990”
data.object.updatedintUnix timestamp when the subscription was updated1300375961
Example Data
{
"id": "mmmm4444nnnn3333pppp",
"type": "subscription.create",
"created": 1622589211,
"data": {
"object": {
"type": "subscription",
"merchant": "aaaa1111bbbb2222cccc",
"public_id": "zzzz9999yyyy8888xxxx",
"customer": "m1234576",
"product": "SKUabc",
"components": [
{"product": "product_1"},
{"product": "product_2"}
],
"extra_data": {},
"quantity": 1,
"price": null,
"frequency_days": 56,
"reminder_days": 10,
"every": 2,
"every_period": 2,
"every_period_display": "Weeks",
"cancelled": 1301325188,
"cancel_reason": "",
"cancel_reason_code": null,
"session_id": "aaaa1111bbbb2222cccc.450125.1299622365",
"merchant_order_id": "12345678",
"live": true,
"external_id": null,
"created": 1300375961,
"start_date": "2021-03-25",
"offer": "a748aa648ac811e8af3bbc764e106cf4",
"payment": "070001bc02fd11e99542bc764e1043b0",
"shipping_address": "66c25cd0564011e9abc5bc764e107990",
"updated": 1300375961
}
}
}