Webhooks

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

Schedule Webhooks Flow


Example webhook payloads

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

{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "paymentIntentId": "056b8046-2f7c-4d97-b5d5-f5f54005db51",
  "event": "payment_intent/created",
  "eventId": "aa8f7239-101c-4553-afdd-9689a4ac46cd"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "paymentIntentId": "056b8046-2f7c-4d97-b5d5-f5f54005db51",
  "event": "payment_intent/completed",
  "eventId": "1ecfb159-e506-48a3-895e-aed5241db4d9"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/created",
  "eventId": "5f519a62-87e1-45ce-be36-d2b185994c21",
  "scheduledPaymentId": "65c6f9cd-e69f-46cd-8103-80b42dd61bfd"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/created",
  "eventId": "c8e0dd66-5939-425d-bfd2-900ffa6921ae",
  "scheduledPaymentId": "502b68b5-f82a-4d1c-bcb3-e1e61fadc48a"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/all_created",
  "eventId": "4f45ca0a-3286-47b4-b8b3-195cd35cac01"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/completed",
  "eventId": "1d5d1aab-fc1a-40d4-aeae-15e7b9c11a10",
  "scheduledPaymentId": "65c6f9cd-e69f-46cd-8103-80b42dd61bfd"
}
{
  "paymentRequestId": "a0ed730e-5a44-491f-9a32-aa295c399fdf",
  "event": "scheduled_payment/completed",
  "eventId": "9ebc222b-a94d-41e1-ad52-c0cf26f0357e",
  "scheduledPaymentId": "502b68b5-f82a-4d1c-bcb3-e1e61fadc48a"
}
{
  "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 schedule (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.