Server Events Attributes
This section provides details on Server Events attributes
Attributes available
Attribute | Mandatory | Description |
---|---|---|
api_version | Yes | int Contains the webhook API version |
event_name | Yes | string Contains the name of the event |
event_id | Yes | string Contains 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 | int in 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 | string Contains 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 | string Contains the user_id that holds the purchase.That attribute will be filled with the user_id you provided to the SDK. |
store | No | string Contains the name of the Store through which the purchase was made. Possible values: APPLE_APP_STORE GOOGLE_PLAY_STORE AMAZON_APPSTORE HUAWEI_APPGALLERY STRIPE |
purchase_type | Yes | string Contains the type of In-App Purchase Possible values: CONSUMABLE NON_CONSUMABLE NON_RENEWING_SUBSCRIPTION RENEWING_SUBSCRIPTION |
product | Yes | string Contains the Product id (=subscription group id) that carries the plan that was bought. |
plan | No | string Contains the Plan id that was bought. |
content_id | No | string Contains the content_id you may have set on the SDK to display the paywall |
customer_currency | No | string in ISO 4217 Contains the customers's store currency. |
plan_price_in_xxx | No | float Contains 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 | float Contains 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). |
amount_in_xxx | No | float ⚠️ Only available for the event TRANSACTION_PROCESSED .Contains 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. xxx is the ISO 4217 code of the currency and will be replaced accordingly to the selected currency in the settings. |
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 | string ⚠️ Only available for the event TRANSACTION_PROCESSED .Contains the name of the subscription event which was associated with the event TRANSACTION_PROCESSED . |
cumulated_revenues_in_xxx | No | float Contains 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 | string Contains the Plan vendor id the customer used to have before changing plan. Used with for the following events: SUBSCRIPTION_CROSSGRADED SUBSCRIPTION_DOWNGRADED SUBSCRIPTION_UPGRADED |
device_type | No | string Contains the device type associated with the purchase. Possible values: COMPUTER PAD PHONE TV |
store_country | Yes | string in ISO 3166 Contains the store country where the purchase was made. Can be NULL in case the subscription was purchased before Purchasely was implemented in your system. |
purchasely_subscription_id | No | string Contains the Purchasely internal unique idendifier of the subscription. Used with events that regards a subscription. |
from_purchasely_subscription_id | No | string Used with events that regards a subscription. Contains the Purchasely internal unique idenditifier of the subscription Used with for the following events: SUBSCRIPTION_CROSSGRADED SUBSCRIPTION_DOWNGRADED SUBSCRIPTION_UPGRADED |
purchasely_one_time_purchase_id | No | string Contains the Purchasely internal unique idendifier of the one time purchase. Used with all events that regards a one time purchase. |
store_product_id | Yes | string Contains the product_id you created in the store console. |
store_transaction_id | Yes | string Contains the transaction_id given by the store. |
purchased_at | Yes | string in ISO 8601 Contains the date of the last transaction (original purchase or renewal). |
purchased_at_ms | Yes | int in milliseconds since the Epoch Contains the date of the last transaction (original purchase or renewal). |
store_original_transaction_id | Yes | string Contains the store_transaction_id of the first transaction. |
original_purchased_at | Yes | string in ISO 8601 Contains the date of the first transaction. |
original_purchased_at_ms | Yes | int in milliseconds since the Epoch Contains the date of the first transaction. |
transferred_from_anonymous_user_id | No | string Contains 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 | string Contains the anonymous_user_id the subscription was transferred to.That attribute is filled for the following event: SUBSCRIPTION_TRANSFERRED |
transferred_from_user_id | No | string Contains the user_id the subscription was transferred from.That attribute is filled for the following event : SUBSCRIPTION_RECEIVED |
transferred_to_user_id | No | string Contains the user_id the subscription was transferred to.That attribute is filled for the following event: SUBSCRIPTION_TRANSFERRED |
environment | Yes | string Contains the environment from where the purchase was made. Possible values: SANDBOX PRODUCTION |
is_family_shared | No | bool Contains true or false depending on if the user has access to the subscription thanks to family sharing. |
previous_offer_type | No | string Contains 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_TRIAL INTRO_OFFER PROMO_CODE PROMOTIONAL_OFFER |
offer_type | Yes | string Contains the current offer the subscription is under. Possible values: NONE : the user is paying the normal price, no offer associatedFREE_TRIAL INTRO_OFFER PROMO_CODE PROMOTIONAL_OFFER |
subscription_status | No | string Contains the current status of the subscription. Filled for events that regards a subscription. Possible Values : AUTO_RENEWING ON_HOLD IN_GRACE_PERIOD AUTO_RENEWING_CANCELED DEACTIVATED REVOKED PAUSED UNPAID |
grace_period_expires_at | No | string in ISO 8601 Filled for events that regards a subscription which is in grace period. Contains the date when the grace period will end. |
grace_period_expires_at_ms | No | int in milliseconds since the Epoch Filled 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 | string in ISO 8601 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. |
effective_next_renewal_at_ms | No | int in 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 | string in ISO 8601 Filled for events that regards a subscription. Contains the theoretical next automatic renewal date. See effective_newt_renewal_at . |
next_renewal_at_ms | No | int in milliseconds since the Epoch Filled for events that regards a subscription. Contains the theoretical next automatic renewal date. See effective_next_renewal_at . |
defer_end_at | No | string in ISO 8601 Filled for events that regards a subscription. Contains the date when the free time offered will be ending. |
defer_end_at_ms | No | int in milliseconds since the Epoch Filled for events that regards a subscription. Contains the date when the free time offered will be ending. |
auto_resume_at | No | string in ISO 8601 Filled 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 | int in 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 | string Contains the id of the associated presentation when the initial purchase was made. |
placement | No | string Contains the id of the placement from where the subscription was bought. |
ab_test | No | string Contains the id of the running AB test when the initial purchase was made. |
ab_test_variant | No | string Contains the id of the AB test variant in which the user was when the initial purchase was made. |
audience | No | string Contains the id of the audience the user matched within the associated placement when the initial purchase was made. |
purchase_token | No | string Filled for events that regards Google Play Store transaction & subscription events Contains 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 | string Filled 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_STARTED PROMO_CODE_CONVERTED PROMO_CODE_NOT_CONVERTED |
offer_identifier | No | string Filled 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_STARTED PROMO_CODE_CONVERTED PROMO_CODE_NOT_CONVERTED PROMOTIONAL_OFFER_STARTED PROMOTIONAL_OFFER_CONVERTED PROMOTIONAL_OFFER_NOT_CONVERTED |
promotional_offer_id | No | string Filled 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_STARTED PROMOTIONAL_OFFER_CONVERTED PROMOTIONAL_OFFER_NOT_CONVERTED |
store_app_bundle_id | Yes | string Contains 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_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": "a2430cab-b56f-45d6-9268-8f9f35e20b59",
"event_name": "TRANSACTION_PROCESSED",
"offer_type": "NONE",
"api_version": 3,
"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
}
Updated 2 months ago