Server Events Attributes
This section provides details on Server Events attributes
Attributes available
| Attribute | Mandatory | Description |
|---|---|---|
api_version | Yes | intContains the webhook API version |
event_name | Yes | stringContains the name of the event |
event_id | Yes | stringContains the unique identifier of the event generated by Purchasely |
event_created_at | Yes | string in ISO 8601 Contains the date which the event was sent the first time. In case of retry that attribute will still be set with the time at the first try. |
event_created_at_ms | Yes | intin milliseconds since the Epoch Contains the date which the event was sent the first time. In case of retry that attribute will still be set with the time at the first try. |
anonymous_user_id | No | stringContains the anonymous_user_id that holds the purchase.That attribute will be filled with a Purchasely generated anonymous_user_id if your app doesn't require the user to be logged in and/or you didn't specified a user_id. |
user_id | No | stringContains the user_id that holds the purchase.That attribute will be filled with the user_id you provided to the SDK. |
store | No | stringContains the name of the Store through which the purchase was made.Possible values:APPLE_APP_STOREGOOGLE_PLAY_STOREAMAZON_APPSTOREHUAWEI_APPGALLERYSTRIPE |
purchase_type | Yes | stringContains the type of In-App PurchasePossible values:CONSUMABLE NON_CONSUMABLENON_RENEWING_SUBSCRIPTIONRENEWING_SUBSCRIPTION |
product | Yes | stringContains the Product id (=subscription group id) that carries the plan that was bought. |
plan | No | stringContains the Plan id that was bought. |
content_id | No | stringContains the content_id you may have set on the SDK to display the paywall |
customer_currency | No | stringinISO 4217Contains the customer's store currency. |
plan_price_in_xxx | No | floatContains the price plan in the current period of its subscription (so 0 during a free trial) using the Default integration currency defined in the App Settings. This amount includes VAT..xxx is the ISO 4217 code of the currency and will be replaced accordingly to the selected currency in the settings. |
plan_price_in_customer_currency | No | floatContains the price paid by a customer in its own currency (customer_currency) in the current period of its subscription (so 0 during a free trial). |
full_plan_price_in_xxx | No | float⚠️ Only available for Google Play Store subscriptions.Contains the full regular plan price, ignoring any active intro offer, promotional offer, promo code or free trial (i.e. the price that will be charged once any offer phase ends), using the Default integration currency defined in the App Settings. This amount includes VAT.xxx is the ISO 4217 code of the currency and will be replaced accordingly to the selected currency in the settings. |
full_plan_price_in_customer_currency | No | float⚠️ Only available for Google Play Store subscriptions.Contains the full regular plan price in the customer's own currency (customer_currency), ignoring any active intro offer, promotional offer, promo code or free trial (i.e. the price that will be charged once any offer phase ends). This amount includes VAT. |
amount_in_usd | No | float⚠️ Only available for the event TRANSACTION_PROCESSED.Contains the amount of the transaction associated with the event TRANSACTION_PROCESSED using the pivot currency which is USD. This amount includes VAT.This amount can also be negative in case of a refund or an plan upgrade with a partial refund. |
amount_in_xxx | No | float⚠️ Only available for the event TRANSACTION_PROCESSED.xxx is the ISO 4217 code of the currency and will be replaced accordingly to the selected currency in the settings.⚠️ This field is only present if the selected currency in the settings is different from USDContains the amount of the transaction associated with the event TRANSACTION_PROCESSED using the Default integration currency defined in the App Settings. This amount includes VAT.This amount can also be negative in case of a refund or an plan upgrade with a partial refund. |
amount_in_customer_currency | No | string⚠️ Only available for the event TRANSACTION_PROCESSED.Contains the amount paid by a customer in the current period of its subscription (so 0 during a free trial) using the currency defined in Purchasely's App Settings. |
source_event_name | No | stringContains the name of the subscription event which was associated with the event. This is useful for events such as:ACTIVATEDEACTIVATETRANSACTION_PROCESSED |
cumulated_revenues_in_xxx | No | floatContains the cumulated revenues for the associated user in the currency defined in Purchasely's App Settings. This amount is VAT included.xxx is the ISO 4217 code of the currency and will be replaced accordingly to the selected currency in the settings. |
previous_plan | No | stringContains the Plan vendor id the customer used to have before changing plan.Used with for the following events:SUBSCRIPTION_CROSSGRADEDSUBSCRIPTION_DOWNGRADEDSUBSCRIPTION_UPGRADED |
previous_store_product_id | No | stringContains the store product_id the customer used to have before changing plan.Used with for the following events:SUBSCRIPTION_CROSSGRADEDSUBSCRIPTION_DOWNGRADEDSUBSCRIPTION_UPGRADED |
device_id | No | stringContains the device id associated with the purchase.This attribute is analogous to the anonymous_user_id and is auto generated by the Purchasely SDK |
device_type | No | stringContains the device type associated with the purchase.Possible values:COMPUTERPADPHONETV |
store_country | Yes | string
NULL in case the subscription was purchased before Purchasely was implemented in your system. |
purchasely_subscription_id | No | stringContains the Purchasely internal unique identifier of the subscription.Used with events that regards a subscription. |
from_purchasely_subscription_id | No | stringUsed with events that regards a subscription.Contains the Purchasely internal unique identifier of the subscriptionUsed with for the following events:SUBSCRIPTION_CROSSGRADEDSUBSCRIPTION_DOWNGRADEDSUBSCRIPTION_UPGRADED |
purchasely_one_time_purchase_id | No | stringContains the Purchasely internal unique identifier of the one time purchase.Used with all events that regards a one time purchase. |
store_product_id | Yes | stringContains the product_id you created in the store (Apple App Store, Google Play Console...) |
store_transaction_id | Yes | stringContains the transaction_id given by the store. |
purchased_at | Yes | stringin ISO 8601Contains the date of the last transaction (original purchase or renewal). |
purchased_at_ms | Yes | intin milliseconds since the EpochContains the date of the last transaction (original purchase or renewal). |
store_original_transaction_id | Yes | stringContains the store_transaction_id of the first transaction. |
original_purchased_at | Yes | stringin ISO 8601Contains the date of the first transaction. |
original_purchased_at_ms | Yes | intin milliseconds since the EpochContains the date of the first transaction. |
transferred_from_anonymous_user_id | No | stringContains the anonymous_user_id the subscription was transferred from.That attribute is filled for the following event:SUBSCRIPTION_RECEIVED |
transferred_to_anonymous_user_id | No | stringContains the anonymous_user_id the subscription was transferred to.That attribute is filled for the following event:SUBSCRIPTION_TRANSFERRED |
transferred_from_user_id | No | stringContains the user_id the subscription was transferred from.That attribute is filled for the following event :SUBSCRIPTION_RECEIVED |
transferred_to_user_id | No | stringContains the user_id the subscription was transferred to.That attribute is filled for the following event:SUBSCRIPTION_TRANSFERRED |
environment | Yes | stringContains the environment from where the purchase was made.Possible values:SANDBOXPRODUCTION |
is_family_shared | No | boolContains true or false depending on if the user has access to the subscription thanks to family sharing. |
previous_offer_type | No | stringContains the previous offer the subscription was under.That attribute is always filled for events that regards subscriptions except for the very first ACTIVATE and SUBSCRIPTION_STARTED.Possible values:NONE: the user was paying the normal price, no offer associatedFREE_TRIALINTRO_OFFERPROMO_CODEPROMOTIONAL_OFFER |
offer_type | Yes | stringContains the current offer the subscription is under.Possible values:NONE: the user is paying the normal price, no offer associatedFREE_TRIALINTRO_OFFERPROMO_CODEPROMOTIONAL_OFFER |
subscription_status | No | stringContains the current status of the subscription.Filled for events that regards a subscription.Possible Values :AUTO_RENEWINGON_HOLDIN_GRACE_PERIODAUTO_RENEWING_CANCELEDDEACTIVATEDREVOKEDPAUSEDUNPAID |
grace_period_expires_at | No | string
|
grace_period_expires_at_ms | No | intin milliseconds since the EpochFilled for events that regards a subscription which is in grace period.Contains the date when the grace period will end |
effective_next_renewal_at | No | stringin ISO 8601Filled for events that regards a subscription.Contains the effective next renewal date, taking any grace or defer periods into account. If the subscription isn’t in grace or deferring period the effective date is equal to next_renewal_at. |
effective_next_renewal_at_ms | No | intin milliseconds since the Epoch.Filled for events that regards a subscription.Contains the effective next renewal date, taking any grace or defer periods into account. If the subscription isn’t in grace or deferring period the effective date is equal to next_renewal_at. |
next_renewal_at | No | stringin ISO 8601Filled for events that regards a subscription.Contains the theoretical next automatic renewal date.See effective_newt_renewal_at. |
next_renewal_at_ms | No | intin milliseconds since the EpochFilled for events that regards a subscription.Contains the theoretical next automatic renewal date.See effective_next_renewal_at. |
defer_end_at | No | stringin ISO 8601Filled for events that regards a subscription.Contains the date when the free time offered will be ending. |
defer_end_at_ms | No | intin milliseconds since the EpochFilled for events that regards a subscription.Contains the date when the free time offered will be ending. |
auto_resume_at | No | stringin ISO 8601Filled for events that regards a subscription.Contains the date when the pause will be ending and the subscription will resume. |
auto_resume_at_ms | No | intin milliseconds since the Epoch.Filled for events that regards a subscription.Contains the date when the pause will be ending and the subscription will resume. |
presentation | No | stringContains the id of the associated presentation when the initial purchase was made. |
placement | No | stringContains the id of the placement from where the subscription was bought. |
ab_test | No | stringContains the id of the running AB test when the initial purchase was made. |
ab_test_variant | No | stringContains the id of the AB test variant in which the user was when the initial purchase was made. |
audience | No | stringContains the id of the audience the user matched within the associated placement when the initial purchase was made. |
purchase_token | No | stringFilled for events that regards Google Play Store transaction & subscription eventsContains the purchase token which is a unique identifier that represents the user and the store product ID for the in-app product they purchased |
offer_code_ref_name | No | stringFilled for events that regards a subscription.Contains the offer code ref name used when a customer successfully redeems an offer code.This attribute is filled for the following event :PROMO_CODE_STARTEDPROMO_CODE_CONVERTEDPROMO_CODE_NOT_CONVERTED |
offer_identifier | No | stringFilled for events that regards a subscription.Contains the offer identifier used when a customer successfully redeems an offer code or a promotional offer.This attribute is filled for the following event :PROMO_CODE_STARTEDPROMO_CODE_CONVERTEDPROMO_CODE_NOT_CONVERTEDPROMOTIONAL_OFFER_STARTEDPROMOTIONAL_OFFER_CONVERTEDPROMOTIONAL_OFFER_NOT_CONVERTED |
promotional_offer_id | No | stringFilled for events that regards a subscription.Contains the promotional offer identifier used when a customer successfully redeems a promotional offer.This attribute is filled for the following event :PROMOTIONAL_OFFER_STARTEDPROMOTIONAL_OFFER_CONVERTEDPROMOTIONAL_OFFER_NOT_CONVERTED |
store_app_bundle_id | Yes | stringContains the store bundle ID of the app in which the purchase was made. |
Sample JSON Payloads
{
"plan": "monthly",
"store": "GOOGLE_PLAY_STORE",
"product": "PURCHASELY_PLUS",
"user_id": "toto",
"event_id": "5e45109f-7fac-45f8-a7e4-464892d5d35d",
"event_name": "ACTIVATE",
"offer_type": "NONE",
"api_version": 3,
"device_id": "1234567890abcdef",
"device_type": "PHONE",
"environment": "SANDBOX",
"purchased_at": "2023-12-12T14:13:11.777Z",
"purchase_type": "RENEWING_SUBSCRIPTION",
"store_country": "FR",
"next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchased_at_ms": 1702390391777,
"event_created_at": "2023-12-12T14:19:26.120Z",
"is_family_shared": false,
"store_product_id": "com.purchasely.plus.monthly",
"customer_currency": "EUR",
"plan_price_in_eur": 9.99,
"source_event_name": "SUBSCRIPTION_RENEWED",
"next_renewal_at_ms": 1702390991777,
"event_created_at_ms": 1702390766120,
"previous_offer_type": "NONE",
"store_app_bundle_id": "com.purchasely.demo",
"subscription_status": "AUTO_RENEWING",
"store_transaction_id": "GPA.3355-5688-7970-28037..5",
"original_purchased_at": "2023-12-12T13:48:16.233Z",
"original_purchased_at_ms": 1702388896233,
"cumulated_revenues_in_eur": 69.9,
"effective_next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchasely_subscription_id": "subs_D7GnVQbUxvY6YxoeK6nhyPDkmyCVcfe",
"effective_next_renewal_at_ms": 1702390991777,
"store_original_transaction_id": "GPA.3355-5688-7970-28037",
"plan_price_in_customer_currency": 9.99
}{
"plan": "monthly",
"store": "GOOGLE_PLAY_STORE",
"product": "PURCHASELY_PLUS",
"user_id": "toto",
"event_id": "a2430cab-b56f-45d6-9268-8f9f35e20b59",
"event_name": "TRANSACTION_PROCESSED",
"offer_type": "NONE",
"api_version": 3,
"device_id": "1234567890abcdef",
"device_type": "PHONE",
"environment": "SANDBOX",
"purchased_at": "2023-12-12T14:13:11.777Z",
"amount_in_eur": 9.99,
"purchase_type": "RENEWING_SUBSCRIPTION",
"store_country": "FR",
"next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchased_at_ms": 1702390391777,
"event_created_at": "2023-12-12T14:19:26.120Z",
"is_family_shared": false,
"store_product_id": "com.purchasely.plus.monthly",
"customer_currency": "EUR",
"plan_price_in_eur": 9.99,
"source_event_name": "SUBSCRIPTION_RENEWED",
"next_renewal_at_ms": 1702390991777,
"event_created_at_ms": 1702390766120,
"previous_offer_type": "NONE",
"store_app_bundle_id": "com.purchasely.demo",
"subscription_status": "AUTO_RENEWING",
"store_transaction_id": "GPA.3355-5688-7970-28037..5",
"original_purchased_at": "2023-12-12T13:48:16.233Z",
"original_purchased_at_ms": 1702388896233,
"cumulated_revenues_in_eur": 69.9,
"effective_next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchasely_subscription_id": "subs_D7GnVQbUxvY6YxoeK6nhyPDkmyCVcfe",
"amount_in_customer_currency": 9.99,
"effective_next_renewal_at_ms": 1702390991777,
"store_original_transaction_id": "GPA.3355-5688-7970-28037",
"plan_price_in_customer_currency": 9.99
}{
"plan": "monthly",
"store": "GOOGLE_PLAY_STORE",
"product": "PURCHASELY_PLUS",
"event_id": "1a03612c-4960-40be-bc69-eeab14f9c6e9",
"event_name": "SUBSCRIPTION_STARTED",
"offer_type": "NONE",
"api_version": 3,
"device_type": "PHONE",
"environment": "SANDBOX",
"purchased_at": "2023-12-12T13:48:16.233Z",
"purchase_type": "RENEWING_SUBSCRIPTION",
"store_country": "FR",
"next_renewal_at": "2023-12-12T13:53:11.777Z",
"purchased_at_ms": 1702388896233,
"event_created_at": "2023-12-12T13:51:04.953Z",
"is_family_shared": false,
"store_product_id": "com.purchasely.plus.monthly",
"anonymous_user_id": "5ca811b6-46e9-4847-9381-3911bd5fcd7b",
"customer_currency": "EUR",
"plan_price_in_eur": 9.99,
"next_renewal_at_ms": 1702389191777,
"event_created_at_ms": 1702389064953,
"store_app_bundle_id": "com.purchasely.demo",
"subscription_status": "AUTO_RENEWING",
"store_transaction_id": "GPA.3355-5688-7970-28037",
"original_purchased_at": "2023-12-12T13:48:16.233Z",
"original_purchased_at_ms": 1702388896233,
"cumulated_revenues_in_eur": 9.99,
"effective_next_renewal_at": "2023-12-12T13:53:11.777Z",
"purchasely_subscription_id": "subs_D7GnVQbUxvY6YxoeK6nhyPDkmyCVcfe",
"effective_next_renewal_at_ms": 1702389191777,
"store_original_transaction_id": "GPA.3355-5688-7970-28037",
"plan_price_in_customer_currency": 9.99
}{
"plan": "monthly",
"store": "GOOGLE_PLAY_STORE",
"product": "PURCHASELY_PLUS",
"user_id": "toto",
"event_id": "112d1a2d-b847-43a7-b6a1-c4a6819b7e54",
"event_name": "SUBSCRIPTION_RENEWED",
"offer_type": "NONE",
"api_version": 3,
"device_type": "PHONE",
"environment": "SANDBOX",
"purchased_at": "2023-12-12T14:13:11.777Z",
"purchase_type": "RENEWING_SUBSCRIPTION",
"store_country": "FR",
"next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchased_at_ms": 1702390391777,
"event_created_at": "2023-12-12T14:19:26.120Z",
"is_family_shared": false,
"store_product_id": "com.purchasely.plus.monthly",
"customer_currency": "EUR",
"plan_price_in_eur": 9.99,
"next_renewal_at_ms": 1702390991777,
"event_created_at_ms": 1702390766120,
"previous_offer_type": "NONE",
"store_app_bundle_id": "com.purchasely.demo",
"subscription_status": "AUTO_RENEWING",
"store_transaction_id": "GPA.3355-5688-7970-28037..5",
"original_purchased_at": "2023-12-12T13:48:16.233Z",
"original_purchased_at_ms": 1702388896233,
"cumulated_revenues_in_eur": 69.9,
"effective_next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchasely_subscription_id": "subs_D7GnVQbUxvY6YxoeK6nhyPDkmyCVcfe",
"effective_next_renewal_at_ms": 1702390991777,
"store_original_transaction_id": "GPA.3355-5688-7970-28037",
"plan_price_in_customer_currency": 9.99
}{
"plan": "monthly",
"store": "GOOGLE_PLAY_STORE",
"product": "PURCHASELY_PLUS",
"user_id": "toto",
"event_id": "e6ac15d9-4dda-4559-bee3-ccb5dad49240",
"event_name": "SUBSCRIPTION_TERMINATED",
"offer_type": "NONE",
"api_version": 3,
"device_type": "PHONE",
"environment": "SANDBOX",
"purchased_at": "2023-12-12T14:18:11.777Z",
"purchase_type": "RENEWING_SUBSCRIPTION",
"store_country": "FR",
"next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchased_at_ms": 1702390691777,
"event_created_at": "2023-12-12T14:24:09.412Z",
"is_family_shared": false,
"store_product_id": "com.purchasely.plus.monthly",
"customer_currency": "EUR",
"plan_price_in_eur": 9.99,
"next_renewal_at_ms": 1702390991777,
"event_created_at_ms": 1702391049412,
"previous_offer_type": "NONE",
"store_app_bundle_id": "com.purchasely.demo",
"subscription_status": "UNPAID",
"store_transaction_id": "GPA.3355-5688-7970-28037..5",
"original_purchased_at": "2023-12-12T13:48:16.233Z",
"original_purchased_at_ms": 1702388896233,
"cumulated_revenues_in_eur": 69.9,
"effective_next_renewal_at": "2023-12-12T14:23:11.777Z",
"purchasely_subscription_id": "subs_D7GnVQbUxvY6YxoeK6nhyPDkmyCVcfe",
"effective_next_renewal_at_ms": 1702390991777,
"store_original_transaction_id": "GPA.3355-5688-7970-28037",
"plan_price_in_customer_currency": 9.99
}