Subscription Events
- 13 May 2024
- 5 Minutes to read
- Contributors
- Print
- DarkLight
Subscription Events
- Updated on 13 May 2024
- 5 Minutes to read
- Contributors
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
The event body for a subscription created and updated event matches the Subscription API format, for example:
Subscription Created and Updated
{
"contractId": "1843184220912258938881652046492359617400310",
"createdAt": "2024-03-04T21:22:45.478Z",
"customerId": "customer-identifier",
"status": "ACTIVE",
"subscriptionTypeId": "eb1e8c13-f750-46cf-a9dd-2b41ade213cd",
"updatedAt": "2024-03-05T08:42:20.937Z",
"version": 61439,
"metadata": [
{
"key": "VIP",
"value": true
}
],
"discounts": [{ "code": "10_OFF" }],
"credit": [
{
"type": "OrderCredit",
"value": 3
}
],
"tenantId": "merchant-tenant-id",
"subscriptionType": {
"name": "Main Product Subscription",
"shortDescription": "A subscription with a trial phase, main phase, and loyalty phase.",
"description": "A subscription with a trial phase, main phase, and loyalty phase. In later phases the customer has access to different billing options.",
"typeId": "molestias",
"createdAt": "2024-03-05T04:58:55.677Z",
"updatedAt": "2024-03-04T15:40:04.382Z",
"status": "ACTIVE",
"phases": [
{
"id": "3fd4e503-fa2f-442b-9802-4e9ad15c18ad",
"name": "Trial Phase",
"deliveryCadenceOptions": [
{
"duration": "MONTH",
"values": [1, 2, 3]
}
],
"terminationCriteria": [
{
"orderOrdinal": 3
}
],
"presets": [],
"productOptions": [
{
"items": [
{
"type": "collection",
"id": "1"
}
],
"quantity": [6]
}
],
"billingOptions": {
"frequency": {
"durationUnit": "EVERY_N_ORDER",
"values": [1]
}
},
"pricingCalculator": {
"engine": "fixedBasePrice",
"configuration": {
"basePrice": 10
}
}
},
{
"id": "3fd4e503-fa2f-442b-9802-4e9ad15c18ad",
"name": "Main Phase",
"deliveryCadenceOptions": [
{
"duration": "MONTH",
"values": [1, 2, 3]
}
],
"terminationCriteria": [
{
"orderOrdinal": 24
}
],
"presets": [],
"productOptions": [
{
"items": [
{
"type": "collection",
"id": "1"
}
],
"quantity": [6]
}
],
"billingOptions": {
"frequency": {
"durationUnit": "EVERY_N_ORDER",
"values": [1, 2, 3]
}
},
"pricingCalculator": {
"engine": "fixedBasePrice",
"configuration": {
"basePrice": 100
}
}
},
{
"id": "3fd4e503-fa2f-442b-9802-4e9ad15c18ad",
"name": "Loyalty Phase",
"deliveryCadenceOptions": [
{
"duration": "MONTH",
"values": [1, 2, 3]
}
],
"presets": [],
"productOptions": [
{
"items": [
{
"type": "collection",
"id": "1"
}
],
"quantity": [6]
}
],
"billingOptions": {
"frequency": {
"durationUnit": "EVERY_N_ORDER",
"values": [1, 2, 3, 6]
}
},
"pricingCalculator": {
"engine": "fixedBasePrice",
"configuration": {
"basePrice": 80
}
}
}
]
},
"phases": [
{
"id": "trial-phase-id",
"deliveryCadence": {
"durationUnit": "MONTH",
"quantity": 1
},
"billing": {
"frequency": {
"durationUnit": "EVERY_N_ORDER",
"quantity": 1
}
},
"products": [
{
"id": "product-id-1",
"quantity": 6
}
]
},
{
"id": "main-phase-id",
"deliveryCadence": {
"durationUnit": "MONTH",
"quantity": 1
},
"billing": {
"frequency": {
"durationUnit": "EVERY_N_ORDER",
"quantity": 2
}
},
"products": [
{
"id": "product-id-2",
"quantity": 3
},
{
"id": "product-id-2",
"quantity": 3
}
]
},
{
"id": "loyalty-phase-id",
"deliveryCadence": {
"durationUnit": "MONTH",
"quantity": 1
},
"billing": {
"frequency": {
"durationUnit": "6",
"quantity": "EVERY_N_ORDER"
}
},
"products": [
{
"id": "product-id-2",
"quantity": 3
},
{
"id": "product-id-3",
"quantity": 5
}
]
}
],
"deliveryDetails": {
"addressId": "12345",
"nextOrderOverride": null,
"previousOrder": {
"deliveryDate": "2024-01-01",
"orderOrdinal": [1]
},
"adjustedDates": [["2024-12-25", "2024-12-30"]],
"baseDate": "2024-01-01"
},
"paymentMethod": {
"source": "STRIPE",
"token": "my-payment-token"
}
}
Was this article helpful?