Subscription Event Structure
Subscription Event
Property Name | Description |
---|---|
event* (required) |
|
properties* |
Required properties All properties related to order should be present inside properties, You be sent your custom event properties here too. |
user_properties* |
|
time* | "time": { |
appClientId* |
|
Subscription Properties
Property Name | Description |
---|---|
orderId* (required) |
|
orderDbKey |
|
amount* |
|
start | "2025-01-05T17:28:18+00:00" |
end |
|
nextPayment |
|
lastPayment |
|
trialEnd |
|
createdAt |
|
status |
|
shippingPhone | All string properties, and optional
|
items* | "items": [{
|
User Properties Object (user_properties)
Example:
{
event: "subscription",
properties: {},
userProperties: {} // User Properties
}
Property Name | Description |
---|---|
uid* (required) | Unique Id of the user. |
phone | Phone number of the user. |
Email address of the user. | |
firstName | First name of the user |
lastName | Last name of the user. |
billingAddress | "billingAddress": { Billing details of the customer. |
shippingAddress | "shippingAddress": { |
Custom Properties | Any other properties which belong's to user. |
Sample Order Event
{
"event": "subscription",
"properties": {
"orderId": "11111",
"email": "[email protected]",
"amount": 169.97, //required
"start": "2025-01-05T17:28:18+00:00",
"trialEnd": "2025-01-05T17:28:18+00:00", //leave it empty if not available
"nextPayment": "2025-01-05T17:28:18+00:00",
"lastPayment": "2025-01-05T17:28:18+00:00", //leave it empty if not available
"end": "2025-02-05T17:28:18+00:00", //leave it empty if not available
"shippingPhone": null,
"shippingCity": "LOCKPORT",
"shippingPostcode": "60441",
"shippingState": "Illinois",
"shippingCountry": "United States",
"shippingAddressLine1": "201B, lotus CHS",
"shippingAddressLine2": "",
"shippingFirstName": "Shubhanshu",
"shippingLastName": "Chouhan",
"status": "active",
"items": [{ //required
"id": "2493989519418",
"price": 49.99, //required
"optionId": "31858336956474",
"sku": "A31SSUJZ99COMTL1",
"name": "My Product - L",
"grams": 454,
"quantity": 1, //required
"imageURL": [
"https://cdn.abc.com/s/files/1/1067/2582/products/product1.jpg?v=1605207140"
]
},
{
"id": "4586759913530",
"price": 49.99,
"optionId": "32132068311098",
"sku": "A31SSUGI85ODGDM1",
"name": "My Product - M",
"grams": 454,
"quantity": 1,
"imageURL": [
"https://cdn.abc.com/s/files/1/1067/2582/products/product2.jpg?v=1605207140"
]
}
]
},
"user_properties": { //required
"uid": "[email protected]", //required, Customer user id in database
"phone": null,
"email": "[email protected]",
"firstName": "Shubhanshu",
"lastName": "Chouhan",
"billingAddress": {
"firstName": "Shubhanshu",
"lastName": "Chouhan",
"city": "LOCKPORT",
"state": "Illinois",
"stateCode": "IL",
"country": "United States",
"countryCode": "US",
"postcode": "60441",
"phone": null,
"address1": "201B, lotus chs",
"address2": "",
"company": ""
},
"shippingAddress": {
"firstName": "Shubhanshu",
"lastName": "Chouhan",
"city": "LOCKPORT",
"state": "Illinois",
"stateCode": "IL",
"country": "United States",
"countryCode": "US",
"postcode": "60441",
"phone": null,
"address1": "201B, lotus chs",
"address2": "",
"email": "[email protected]"
},
},
"time": {
"sentAt": "2025-01-05T17:28:18+00:00" //when event occurred, use this property in case you're updating old orders, or synchronizing old orders
},
"appClientId": "API_KEY" //change for each website, can be found in Richpanel app.
}
API Reference:https://developer.richpanel.com/reference/create-a-subscription
Note:
- Make sure to follow the proper format
- Don't send empty values.
Updated 12 days ago