Name of the event received.
Subscription Webhook Events
Listen to subscription events to keep your integration always synchronized.
Webhooks are the safest and most reliable way to stay updated in real time. Your application receives a notification whenever the status of a subscription changes.
Every business in participants receives its own notification. participants brings only the id and name of each business.
Subscription Events
- subscription.created — Subscription created.
- subscription.updated — Subscription updated.
- subscription.activated — Subscription activated.
- subscription.canceled — Subscription canceled.
- subscription.deactivated — Subscription deactivated automatically, because the last retry of a recurrence also failed. See
retryin Create subscription. - subscription.expired — Subscription expired.
- subscription.inactivated — Subscription inactivated manually.
Deactivated or inactivated
In both cases the status of the subscription becomes inactive; the subscription is not canceled. The event tells you why:
subscription.deactivatedis automatic. Easyflow sends it when a recurrence used all its retries without being paid.subscription.inactivatedis sent when the subscription is inactivated manually. It comes together withsubscription.updated.
Origin of the subscription
Besides subscriptions from an offer (origin equal to offer), a subscription can be created through the API (api) or by a buyer who subscribes through a recurring payment link (payment-link). Subscriptions created through the API or by a payment link send the same events listed above; no event is specific to either origin. They are created as soon as the first order is charged, whatever the result of the card: subscription.created is sent and, if the first order is refused, subscription.canceled follows.
The webhook payload does not include origin. To know how a subscription was created, read origin in Get subscription or Filter subscription.
Order and payment link of the subscription
Every subscription.* event brings orderId and paymentLinkId, right after id. Both keys are always present, and a missing value comes as null, never as a missing key:
orderIdis the order of the subscription. For a subscription created through the API or by a payment link, it is the order of the first cycle. For a subscription from an offer, it is the order of the purchase.paymentLinkIdis the payment link when the subscription was created by a payment link, andnullfor the other origins.
Use orderId to match subscription.created with the order events of the same order. The subscriptionRecurrence.* events and the response of Get subscription do not change and do not bring these fields.
Events
subscription.createdsubscription.updatedsubscription.activatedsubscription.canceledsubscription.deactivatedsubscription.expiredsubscription.inactivated
Easyflow sends an HTTP request with this payload to the URL registered for your webhook.
Payloadrequired
Webhook payload received by your server in the event of an event.
Content typeapplication/jsonobject
eventstringoccurredAtstring · date-timeDate and time when the notification was sent, in UTC.
payloadobjectComplete subscription data.
Show child attributesHide child attributes
idstring · uuidrequiredorderIdstring · uuidrequirednullableOrder of the subscription. For a subscription created through the API or by a payment link, it is the order of the first cycle. For a subscription from an offer, it is the order of the purchase. The key is always present.
paymentLinkIdstring · uuidrequirednullablePayment link that created the subscription.
nullwhen the subscription was not created by a payment link. The key is always present.namestringcreatedAtstring · date-timeexpirationstring · date-timenullableDate and time when the subscription ends.
nullwhile the date has not been set. For example, a subscription created through the API or by a payment link starts withnull, and the date is set when the subscription is activated.installmentsintegernumberRecurrencesintegerrepeatIndefinitelybooleanperiodicitystringstatusstringpaymentMethodstringrecurrencePaymentStatusstringrecurrenceValueInCentsintegercustomValueobjectCustom value charged in a range of recurrences. The object is always present. Its three fields are
nullwhen the subscription has no custom value, as when it is created through the API or by a payment link.Show child attributesHide child attributes
recurrenceFromintegernullablerecurrenceTointegernullablevalueInCentsintegernullable
retryobjectShow child attributesHide child attributes
intervalInDaysintegerretriesMaxNumberinteger
customerobjectShow child attributesHide child attributes
namestringemailstringphoneobjectShow child attributesHide child attributes
dddstringnumberstringareaCodestringisMobileboolean
documentobjectShow child attributesHide child attributes
typestringnumberstring
deliveryAddressobjectShow child attributesHide child attributes
streetstringneighborhoodstringnumberstringcitystringstatestringzipCodestringcomplementstring
billingAddressobjectShow child attributesHide child attributes
streetstringneighborhoodstringnumberstringcitystringstatestringzipCodestringcomplementstring
participantsarray of objectsShow child attributesHide child attributes
businessobjectShow child attributesHide child attributes
idstring · uuidnamestring