GoCardlessDeveloper Docs
Create a sandbox account

Webhooks for partners#

View as Markdown

A webhook is a real-time request that GoCardless sends to your server to alert you of an event.

Adding support for webhooks allows you to receive real-time notifications from GoCardless when events happen in your account, so you can take automated actions. This is the suggested monitoring approach.

A webhook can contain multiple events, and each has:

  • a resource_type, telling us what kind of resource the event is for, for example, "payments" or "mandates"
  • an action, telling us what happened to the resource, for example, the "failed" action for a payment
  • details, specifying why the event happened
{
  "events": {
    "id": "EV123",
    "created_at": "2014-04-08T17:01::06.000Z",
    "resource_type": "payments",
    "action": "failed",
    "details": {
      "origin": "bank",
      "cause": "insufficient_funds",
      "description": "The customer's account had insufficient funds to make this payment.",
      "scheme": "sepa_core",
      "reason_code": "AM04",
      "will_attempt_retry": false
    },
    "metadata": {},
    "links": {
      "payment": "PM123"
    }
  }
}

Key Webhook Events#

Billing Request Webhooks#

EventDescriptionSuggested Handling
flow_visitedThe billing request flow has been visitedUse to detect payer inactivity and expire the billing request if needed
flow_exitedThe payer exited the flow without completing itConsider triggering a push notification for mobile experiences
bank_authorisation_deniedA bank authorisation was denied by the payerDisplay the denial reason from details.description
bank_authorisation_failedA bank authorisation failed due to a bank account mismatchDisplay the failure reason from details.description
fulfilledThe billing request was fulfilled and the mandate and/or payment have been createdSave the mandate and/or payment ID to your database

billing-request-state-diagram

See the full list of billing request webhooks in the API reference.

Mandate Webhooks#

EventDescriptionSuggested Handling
createdThe mandate has been createdSave the mandate ID to your database
submittedThe mandate has been submitted to the banksUpdate the mandate status in your billing system
activeThe mandate has been successfully set up by the customer's bankUpdate the mandate status in your billing system
failedThe mandate could not be set up — the bank account does not accept Direct Debit or is closedUpdate status; allow the customer to use another payment method or re-attempt with a new account
cancelledThe mandate was cancelled by the customer, via the API, or automatically when their account was closedUpdate status; request a new payment method and cancel any associated subscriptions
expiredNo collections were made within the dormancy period and the mandate has expiredUpdate status; use the reinstate endpoint or create a new mandate
resubmission_requestedA reinstate request was made via the mandate reinstate endpointUpdate the mandate status in your billing system
reinstatedThe mandate has become active again after being cancelled or expiredUpdate the mandate status in your billing system
replacedThe mandate was cancelled and replaced by a new one. The event includes links.new_mandateUpdate the stored mandate ID to the value in links.new_mandate
blockedThe mandate matched fraud information or a block list and cannot be unblockedUpdate status; cancel any subscriptions against this mandate

mandate-state-diagram

See the full list of mandate webhooks in the API reference.

Payment Webhooks#

EventDescriptionSuggested Handling
createdThe payment has been createdSave the payment ID to your database
submittedThe payment has been submitted to the banksUpdate the payment status in your billing system
confirmedThe payment has been collected and is held by GoCardless before payoutUpdate the payment and invoice status
paid_outThe payment has been sent to the creditor's bank accountUpdate the payment and invoice status
failedThe payment could not be collected. If will_attempt_retry is true, Success+ will retry automaticallyUpdate the payment and invoice status
cancelledThe payment was cancelledUpdate the payment and invoice status
resubmission_requestedSuccess+ has scheduled an automatic retry (see failed)Update the payment and invoice status
charged_backThe customer reclaimed the payment via the Direct Debit GuaranteeUpdate the payment and invoice status
chargeback_cancelledThe customer's bank cancelled the chargeback requestUpdate the payment and invoice status

payment-state-diagram

See the full list of payment webhooks in the API reference.

Refund Webhooks#

EventDescriptionSuggested Handling
createdA refund has been created (details.cause: payment_refunded, details.origin: api)Update the refund status and expose it to your merchants
failedThe refund did not reach the customer; funds are returned to you (details.cause: refund_failed)Update the refund status and expose it to your merchants
paidThe refund has been paid to the customer (details.cause: refund_paid)Update the refund status and expose it to your merchants

See the full list of refund webhooks in the API reference.

What's Next?#