Webhooks för prenumerationer
Nyttolasten som skickas till din webhook-slutpunkt när en prenumeration skapas, uppdateras eller ändrar status. Hantera varje händelse för att hålla dina poster synkroniserade.
Prenumerations Webhook Händelser
En prenumeration genererar en händelse i varje steg av sin livscykel:Använda subscription.updated för synkronisering i realtid
Webhooken subscription.updated utlöses när som helst ett prenumerationsfält ändras, vilket gör att du kan hålla din applikationsstatus synkroniserad utan att behöva fråga API:et upprepade gånger:
Webhook Payload Schema
Subscription payload sent on a webhook. It carries every field of
SubscriptionResponse, plus the grace-period deadline.
Addons associated with this subscription
Billing address details for payments
Brand id this subscription belongs to
Indicates if the subscription will cancel at the next billing date
Timestamp when the subscription was created
Credit entitlement cart settings for this subscription
Currency used for the subscription payments
AED, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CHF, CLP, CNY, COP, CRC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, JMD, JOD, JPY, KES, KGS, KHR, KMF, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRU, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLE, SLL, SOS, SRD, SSP, STN, SVC, SZL, THB, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VES, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW Customer details associated with the subscription
Whether a payment method is on file. False while a card-optional subscription waits for the customer to add one.
Additional custom data associated with the subscription
Meter credit entitlement cart settings for this subscription
Meters associated with this subscription (for usage-based billing)
Timestamp of the next scheduled billing. Indicates the end of current billing period
Wether the subscription is on-demand or not
Number of payment frequency intervals
Time interval for payment frequency (e.g. month, year)
Day, Week, Month, Year Timestamp of the last payment. Indicates the start of current billing period
Identifier of the product associated with this subscription
Number of units/items included in the subscription
Amount charged before tax for each recurring payment in the currency's smallest unit (cents for USD, yen for JPY, fils for KWD)
Current status of the subscription
pending, active, on_hold, paused, cancelled, failed, expired, past_due Unique identifier for the subscription
Number of subscription period intervals
Time interval for the subscription period (e.g. month, year)
Day, Week, Month, Year Indicates if the recurring_pre_tax_amount is tax inclusive
Number of days in the trial period (0 if no trial)
Free-text cancellation comment, if any
Customer-supplied churn reason, if any
too_expensive, missing_features, switched_service, unused, customer_service, low_quality, too_complex, other Cancelled timestamp if the subscription is cancelled
Customer's responses to custom fields collected during checkout
Business / legal name associated with the tax id (B2B). When set this is used on the invoice in place of the customer's personal name.
DEPRECATED: Use discounts[].cycles_remaining instead.
DEPRECATED: Use discounts instead. Returns the first discount's ID if present.
All stacked discounts applied, ordered by position
Timestamp when the subscription will expire
Timestamp when the subscription was paused, if it currently is (or is
OnHold due to an unresolved pause settlement). null otherwise.
Saved payment method id used for recurring charges
Scheduled plan change details, if any
Tax identifier provided for this subscription (if applicable)
Per-unit trial amount after discounts, snapshotted at subscription creation (price currency minor units, pre-quantity, pre-tax). Null for a free trial or no trial.
Time when the grace period ends. The subscription moves to on_hold or
to cancelled at this time.
Read in the same query as the rest of the payload, so it always comes
from the row snapshot that produced status. It is set whenever the
subscription sits in a window at that moment. A delayed event of another
type therefore carries the deadline too, next to a past_due status.