Subscription Recurrence Webhook Events

POSThttps://your-server.com/webhooks/easyflow

Listen to subscription recurrence events to keep your integration always synchronized.

Your application receives a notification whenever the status of a recurrence of a subscription changes.

Recurrences paid by credit card are charged to the card saved in the subscription, so they don't need a new card token. The payload brings only the display fields of the card, never the card token.

Recurrence, attempt and retry

A recurrence is a billing cycle of the subscription, not a charge attempt:

  • The id of the recurrence is the same in every attempt of the cycle, the retries included.
  • Each attempt adds a new item to payments, with its own id.
  • retry.retries counts the retries already made in the cycle, and retry.nextRetry is when the next one is due. The rules are in retry of Create subscription.
  • recurrence is the number of the cycle: 1 is the cycle charged when the buyer subscribes, 2 the next one, and so on.

From the second cycle on, Easyflow charges the subscription without creating an order: no order.* event is sent for these cycles, and you follow them with the events below.

Recurrence Events

  • subscriptionRecurrence.canceled — Recurrence canceled.
  • subscriptionRecurrence.delayed — The payment of the recurrence is past due and was not paid. The recurrence follows the same retries as a failed one.
  • subscriptionRecurrence.failed — An attempt to charge the recurrence failed. It is sent for every attempt that fails, not only after the last retry.
  • subscriptionRecurrence.paid — Recurrence paid.

After the last retry fails, Easyflow makes no new attempt. About intervalInDays days later, the subscription becomes inactive and subscription.deactivated is sent.

Events

  • subscriptionRecurrence.canceled
  • subscriptionRecurrence.delayed
  • subscriptionRecurrence.failed
  • subscriptionRecurrence.paid

Easyflow sends an HTTP request with this payload to the URL registered for your webhook.

Payloadrequired

Webhook payload with the data of the subscription recurrence event.

Content typeapplication/jsonobject

  • eventstring

    Name of the event received.

    Possible values:subscriptionRecurrence.canceledsubscriptionRecurrence.delayedsubscriptionRecurrence.failedsubscriptionRecurrence.paid

  • occurredAtstring · date-time

    Date and time when the notification was sent, in UTC.

  • payloadobject

    Complete recurrence data.

    Show child attributesHide child attributes
    • idstring · uuid
    • subscriptionIdstring · uuid
    • statusstring

      Possible values:pendingchargeddelayedfailedpaidcanceledrefunded

    • billingDatestring · date-time
    • createdAtstring · date-time
    • dueDatestring · date-time
    • paidAtstring · date-timenullable
    • recurrenceinteger
    • recurrenceValueInCentsinteger
    • retryobject
      Show child attributesHide child attributes
      • lastRetrystring · date-time
      • nextRetrystring · date-time
      • retriesinteger
    • paymentsarray of objects

      In this event, pix, bankBillet and creditCard are always objects. Their fields are absent when they do not apply to the payment method.

      Show child attributesHide child attributes
      • idstring
      • paymentMethodstring

        Payment method, such as credit-card, pix or bank-billet.

      • statusstring

        Possible values:pendingin-processingauthorizedpaidpartially-paidrefusedabortedcanceledcharged-backchargeback-in-disputeunpaidaccepteddeniedreversedrefunded

      • valueInCentsinteger
      • valuePaidInCentsinteger
      • fineValueInCentsinteger
      • interestValueInCentsinteger
      • installmentsinteger
      • pixobjectnullable
        Show child attributesHide child attributes
        • copyAndPasteCodestringnullable
        • qrCodestringnullable
        • expireAtstring · date-timenullable
      • bankBilletobjectnullable
        Show child attributesHide child attributes
        • expireAtstring · date-timenullable
        • barCodestringnullable
        • linkstringnullable
        • linestringnullable
      • creditCardobjectnullable

        Card used in the payment. Only these display fields are sent. The card token and the card number are never sent.

        Show child attributesHide child attributes
        • last4Numbersstring
        • flagstring

          Possible values:visamastercardamerican-expressdiners-clubdiscoverjcbunionpaymaestromirelohiperhipercard

        • expiresAtYearinteger
        • expiresAtMonthinteger
        • holderNamestring
        • nicknamestring
      • refuseobjectnullable

        Reason why the payment was refused.

        Show child attributesHide child attributes
        • rawDescriptionstring
        • typestringnullable