Scheduled Payment Webhooks

Learn about the webhook flow and payloads for scheduled payments, including error codes that may occur during payment processing.

This section will discuss how each webhook is triggered after each step is completed, affecting the PaymentRequest, PaymentIntent & SchedulePayment entities.

Schedule Webhooks Flow#

The overall flow works as follows: when the payer authorizes the consent, a payment_intent/created webhook is triggered, followed by payment_intent/completed once the intent is confirmed. Then, one scheduled_payment/created webhook is triggered for each scheduled payment, and a scheduled_payment/all_created webhook once every schedule has been registered. As each scheduled payment is executed on its date, a scheduled_payment/completed webhook is triggered (or scheduled_payment/error if it fails), and finally scheduled_payment/all_completed when all schedules have finished.

Example webhook payloads#

Here are examples of webhook payloads in a case with two scheduled payments, and both becoming COMPLETED:

payment_intent/created

payment_intent/created
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "paymentIntentId": "056b8046-2f7c-4d97-b5d5-f5f54005db51",
  "event": "payment_intent/created",
  "eventId": "aa8f7239-101c-4553-afdd-9689a4ac46cd"
}

payment_intent/completed

payment_intent/completed
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "paymentIntentId": "056b8046-2f7c-4d97-b5d5-f5f54005db51",
  "event": "payment_intent/completed",
  "eventId": "1ecfb159-e506-48a3-895e-aed5241db4d9"
}

scheduled_payment/created (1)

scheduled_payment/created (1)
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/created",
  "eventId": "5f519a62-87e1-45ce-be36-d2b185994c21",
  "scheduledPaymentId": "65c6f9cd-e69f-46cd-8103-80b42dd61bfd"
}

scheduled_payment/created (2)

scheduled_payment/created (2)
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/created",
  "eventId": "c8e0dd66-5939-425d-bfd2-900ffa6921ae",
  "scheduledPaymentId": "502b68b5-f82a-4d1c-bcb3-e1e61fadc48a"
}

scheduled_payment/all_created

scheduled_payment/all_created
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/all_created",
  "eventId": "4f45ca0a-3286-47b4-b8b3-195cd35cac01"
}

scheduled_payment/completed (1)

scheduled_payment/completed (1)
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/completed",
  "eventId": "1d5d1aab-fc1a-40d4-aeae-15e7b9c11a10",
  "endToEndId": "E44471172202505211500U0d9ffa12345",
  "scheduledPaymentId": "65c6f9cd-e69f-46cd-8103-80b42dd61bfd"
}

scheduled_payment/completed (2)

scheduled_payment/completed (2)
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/completed",
  "eventId": "9ebc222b-a94d-41e1-ad52-c0cf26f0357e",
  "endToEndId": "E44471172202505211500U0d9ffa12345",
  "scheduledPaymentId": "502b68b5-f82a-4d1c-bcb3-e1e61fadc48a"
}

scheduled_payment/all_completed

scheduled_payment/all_completed
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/all_completed",
  "eventId": "7a9426aa-2ac3-4d8e-a5a4-fe780f116c6b"
}

Example

If you have configured all webhooks, following the example above of flow, this will trigger all those webhooks in that order.

You will receive:

  • Two payment_intent webhooks (created & completed).
  • Five scheduled_payment webhooks.
    • Since in this example we scheduled two payments, we will receive two for each payment that was scheduled (created & completed).
    • One webhook when all schedules have finished.

Webhook Errors#

When you receive a scheduled_payment/error webhook, you can have one of the following error codes.

Error CodeMeaningDescription
INSUFFICIENT_BALANCEInsufficient BalanceThe account doesn't have enough balance to perform the payment.
EXCEEDED_LIMITExceeded LimitThe payment amount exceeds the allowed limit.
INVALID_AMOUNTInvalid AmountThe payment amount provided is invalid.
INVALID_INVOICEInvalid InvoiceThe provided invoice is invalid.
INVALID_CONSENTInvalid ConsentThe consent provided is invalid.
PARAMETER_NOT_PROVIDEDParameter Not ProvidedA required parameter was not provided.
INVALID_PARAMETERInvalid ParameterA parameter provided is invalid.
NOT_PROVIDEDParameter Not ProvidedA required parameter was not provided.
PAYMENT_DIFFERENT_FROM_CONSENTPayment Different from ConsentThe payment differs from the authorized consent.
INVALID_PAYMENT_DETAILInvalid Payment DetailThe payment details provided are invalid.
PAYMENT_REJECTED_BY_HOLDERPayment Rejected by HolderThe account holder rejected the payment.
IDEMPOTENCY_ERRORIdempotency ErrorAn idempotency error occurred, possibly due to duplicate requests.
CONSENT_PENDING_AUTHORIZATIONConsent Pending AuthorizationThe consent is pending authorization.
INFRASTRUCTURE_FAILUREInfrastructure FailureThere was a failure in the infrastructure.
SAME_ACCOUNT_ORIGIN_DESTINATIONSame Account Origin and DestinationThe origin and destination accounts are the same, which is not allowed.
PAYMENT_SCHEDULING_FAILUREPayment Scheduling FailureThere was a failure in scheduling the payment.
UNKNOWN_ERRORUnknown ErrorAn unknown error occurred either at the initiator or account holder side.