Skip to content

Instantly share code, notes, and snippets.

@Dayjo
Created November 19, 2015 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dayjo/711709d1c55b8a5abe6d to your computer and use it in GitHub Desktop.
Save Dayjo/711709d1c55b8a5abe6d to your computer and use it in GitHub Desktop.
gocardless events

Mandate actions

created

The mandate has been created.

submitted

The mandate has been submitted to the banks, and should become active in a few days, unless the bank declines the request.

active

The mandate has been successfully set up by the customer's bank.

reinstated

The mandate has become active again, after it was cancelled or expired. This can be due to the customer's bank wishing to undo a cancellation or expiry notice they sent, or because the mandate was successfully reinstated via the reinstate endpoint.

transferred

The mandate has been transferred to a different bank account. The event will include links[previous_customer_bank_account] and links[new_customer_bank_account], and the mandate may have been submitted again, depending on how the banks involved handled the transfer.

cancelled

The mandate has been cancelled, either by the customer through their bank or this API, or automatically when their bank account is closed.

failed

The mandate could not be set up, generally because the specified bank account does not accept Direct Debit payments or is closed.

expired

No collection attempts were made against the mandate for over 13 months. As a result it has expired, and no further collections can be taken against it. If you wish to continue taking payments from this customer you should request their permission and use the reinstate endpoint.

resubmission_requested

A request to resubmit the mandate was made by the mandate reinstate endpoint.

Mandate causes

mandate_created

The mandate was created through the API or by GoCardless (in the case of a bulk change).

mandate_submitted

The mandate has been submitted to the banks.

mandate_activated

The time window after submission for the banks to refuse a mandate has ended without any errors being received, so this mandate is now active.

mandate_cancelled

The mandate was cancelled either via an API call, or at the bank.

mandate_expired

The mandate is being marked as expired, because no payments have been collected against it for the dormancy period of your Service User Number. You may use the mandate reinstation endpoint to attempt to set this mandate up again.

resubmission_requested

A request to resubmit a mandate was made via the mandate reinstate endpoint.

mandate_reinstated

A cancelled mandate has been re-instated by the customer's bank.

bank_account_closed

The bank account for this mandate is closed. This can be from the customer bank account disable endpoint, or in a message from the banks, indicating that the account has been closed

invalid_bank_details

The bank details used to set up this mandate were rejected.

direct_debit_not_enabled

The bank account specified does not support direct debit.

bank_account_transferred

The customer's bank account was transferred to a different bank or building society. Depending on the bank the account is being transferred to, this may require the mandate to be resubmitted. If so, there will first be an event with action set to submitted, and details[cause] set to bank_account_transferred, followed by a standard mandate_activated event 2 days later, or potentially a failure event if the new bank rejects the mandate. Otherwise, there will just be a single event with action set to transferred, and details[cause] set to bank_account_transferred.

Very occasionally, the transfer message from the banks will not include details of the new bank account. In this case the mandate will fail (if it is being set up), or be cancelled (if it is active).

authorisation_disputed

The customer disputes authorising the mandate.

Payment actions

created

The payment has been created.

submitted

The payment has been submitted to the banks. It will be a few days until it is collected, or fails.

confirmed

The payment has been collected from the customer's bank account, and is now being held by GoCardless. It can take up to 5 working days for a payment to be collected, and will then be held for a short time before becoming paid_out.

cancelled

The payment was cancelled.

failed

The payment could not be collected, usually because the customer did not have sufficient funds available. GoCardless will not automatically retry the payment.

charged_back

The customer asked their bank to refund the payment under the Direct Debit Guarantee, and it has been returned to the customer.

chargeback_cancelled

The customer's bank has cancelled the chargeback request. This is almost always at the request of the customer.

paid_out

The payment has left GoCardless and has been sent to the creditor's bank account.

late_failure_settled

The payment was a late failure which had already been paid out, and has been debited from a payout.

chargeback_settled

The payment was charged back, having previously been paid out, and has been debited from a payout.

resubmission_requested

A request to resubmit the payment was made by the payment retry endpoint.

Payment causes

payment_created

The payment was created through the API or by GoCardless (in the case of a subscription).

| Origin Consequences | | --- || ---- | ---- | ---- | | api Payment created | | gocardless Payment created |

payment_cancelled

Payment cancelled via an API call.

| Origin Consequences | | --- || ---- | ---- | ---- | | api Payment cancelled |

payment_submitted

The payment has now been submitted to the banks, and cannot be cancelled

| Origin Consequences | | --- || ---- | ---- | ---- | | gocardless Payment submitted |

payment_confirmed

Either enough time has passed since the payment was submitted for the banks to return an error, so this payment is now confirmed, or a chargeback on this payment was cancelled by the banks.

Origin Scheme Reason code Consequences
gocardless - - Payment confirmed
bank bacs DDICA-1 Payment chargeback cancelled
bank bacs DDICA-2 Payment chargeback cancelled
bank bacs DDICA-3 Payment chargeback cancelled
bank bacs DDICA-4 Payment chargeback cancelled
bank bacs DDICA-5 Payment chargeback cancelled
bank bacs DDICA-6 Payment chargeback cancelled
bank bacs DDICA-7 Payment chargeback cancelled
bank bacs DDICA-8 Payment chargeback cancelled

payment_paid_out

The payment has been paid out by GoCardless.

| Origin Consequences | | --- || ---- | ---- | ---- | | gocardless Payment paid out |

payment_retried

A request to resubmit a payment was made via the payment retry endpoint.

| Origin Consequences | | --- || ---- | ---- | ---- | | api Payment resubmitted to banks in next batch |

late_failure_settled

The payment has been debited from a payout by GoCardless.

| Origin Consequences | | --- || ---- | ---- | ---- | | gocardless Payment settled against a payout.

chargeback_settled

The payment has been debited from a payout by GoCardless.

| Origin Consequences | | --- || ---- | ---- | ---- | | gocardless Payment settled against a payout.

test_failure

In the sandbox environment, some SEPA payments will be marked as failed, to help with testing of your integration. This cause and reason code will never appear in the live environment.

Origin Scheme Reason code Consequences
bank sepa_core TEST Payment failed
bank sepa_cor1 TEST Payment failed

insufficient_funds

The customer did not have funds available to make the payment.

Origin Scheme Reason code Consequences
bank sepa_core AM04 Payment failed
bank sepa_cor1 AM04 Payment failed

refer_to_payer

The customer's bank wasn't able to pay the Direct Debit. For Bacs, this is almost always due to insufficient funds, but is occasionally used as a catch-all for other failures. For SEPA these codes are instead used to obfuscate the failure cause for privacy and other regulatory reasons.

Origin Scheme Reason code Consequences
bank bacs ARUDD-0 Payment failed
bank sepa_core MS02 Payment failed
bank sepa_core MS03 Payment failed
bank sepa_core RR04 Payment failed
bank sepa_core SL01 Payment failed
bank sepa_cor1 MS02 Payment failed
bank sepa_cor1 MS03 Payment failed
bank sepa_cor1 RR04 Payment failed
bank sepa_cor1 SL01 Payment failed

bank_account_closed

The customer's bank account was closed before the payment could be taken. The mandate will be cancelled.

Origin Scheme Reason code Consequences
api - - Bank account disabled, payment cancelled
bank bacs ADDACS-2 Mandate cancelled, payment cancelled
bank bacs ADDACS-B Mandate cancelled, payment cancelled
bank bacs AUDDIS-2 Mandate failed, payment cancelled
bank bacs AUDDIS-B Mandate failed, payment cancelled
bank bacs ARUDD-2 Payment failed, mandate cancelled
bank bacs ARUDD-B Payment failed, mandate cancelled
bank sepa_core AC04 Payment failed, mandate cancelled
bank sepa_core MD07 Payment failed, mandate cancelled
bank sepa_cor1 AC04 Payment failed, mandate cancelled
bank sepa_cor1 MD07 Payment failed, mandate cancelled

direct_debit_not_enabled

The customer's bank account does not allows direct debit payments. The mandate will also be cancelled.

Origin Scheme Reason code Consequences
bank bacs AUDDIS-F Mandate failed, payment cancelled
bank bacs AUDDIS-G Mandate failed, payment cancelled
bank bacs AUDDIS-N Mandate failed, payment cancelled
bank sepa_core AC06 Payment failed, mandate cancelled
bank sepa_core AG01 Payment failed, mandate cancelled
bank sepa_cor1 AC06 Payment failed, mandate cancelled
bank sepa_cor1 AG01 Payment failed, mandate cancelled

invalid_bank_details

The bank account details used to set up the mandate for this payment were incorrect. The mandate will be cancelled.

Origin Scheme Reason code Consequences
bank bacs ARUDD-5 Payment failed, mandate cancelled
bank bacs ARUDD-Y Payment failed, mandate cancelled
bank bacs AUDDIS-5 Mandate failed, payment cancelled
bank sepa_core AC01 Payment failed, mandate cancelled
bank sepa_cor1 AC01 Payment failed, mandate cancelled

bank_account_transferred

The customer has asked their bank to transfer the mandate for this payment to a new account, but this payment has been submitted to the old account. GoCardless will have automatically transferred the mandate to the new bank account if possible, so this payment can be retried unless the mandate has been cancelled.

Origin Scheme Reason code Consequences
bank bacs ARUDD-3 Payment failed
bank bacs ADDACS-3 Mandate cancelled, payment cancelled
bank bacs ADDACS-C Mandate cancelled, payment cancelled
bank bacs AUDDIS-3 Mandate failed, payment cancelled
bank bacs AUDDIS-C Mandate failed, payment cancelled

mandate_cancelled

Either:

the mandate for this payment is being cancelled by an API call; or the payment failed using a code that indicated that the mandate has been cancelled; or the customer cancelled the mandate via their bank.

Origin Scheme Reason code Consequences
api - - Payment cancelled, mandate cancelled
bank bacs ARUDD-1 Payment failed, mandate cancelled
bank bacs ADDACS-0 Mandate cancelled, payment cancelled
bank bacs ADDACS-1 Mandate cancelled, payment cancelled
bank sepa_core MD01 Payment failed, mandate cancelled
bank sepa_cor1 MD01 Payment failed, mandate cancelled
links[parent_event] will be the ID of the mandate cancellation event if the payment is being cancelled rather than failed.

authorisation_disputed

In SEPA, customers are entitled to a refund of payments they did not authorise within 13 months. In Bacs, there is no time limit on this entitlement.

Origin Scheme Reason code Consequences
bank bacs ARUDD-4 Payment failed
bank bacs ARUDD-7 Payment failed
bank bacs ADDACS-D Mandate cancelled, payment cancelled
bank bacs DDICA-1 Payment charged back
bank bacs DDICA-2 Payment charged back
bank bacs DDICA-4 Payment charged back, mandate cancelled
bank bacs DDICA-5 Payment charged back, mandate cancelled
bank bacs DDICA-6 Payment charged back, mandate cancelled
bank bacs DDICA-8 Payment charged back, mandate cancelled
bank sepa_core MD01 Payment charged back
bank sepa_cor1 MD01 Payment charged back

refund_requested

In SEPA, customers are entitled to a refund for authorised transactions within 8 weeks

Origin Scheme Reason code Consequences
bank sepa_core MD06 Payment charged back
bank sepa_cor1 MD06 Payment charged back

Payout actions

paid

GoCardless has transferred the payout to the creditor's bank account. The details[cause] will always be payout_paid, and the details[origin] will be gocardless.

Refund actions

created

A refund has been created. The details[cause] will be payment_refunded, and the details[origin] will be api.

paid

The refund has been paid to your customer. The details[cause] will be refund_paid, and the details[origin] will be gocardless.

refund_settled

The refund has been deducted from a payout. The details[cause] will be refund_settled, and the details[origin] will be gocardless.

Subscription actions

created

The subscription has been created.

payment_created

A payment has been created by this subscription.

cancelled

This subscription has been cancelled. No further payments will be created.

Subscription causes

subscription_created

The subscription was created through the API.

Origin Consequences
api Subscription created

subscription_cancelled

The subscription was cancelled via the API.

Origin Consequences
api Subscription cancelled

mandate_cancelled

The mandate for this subscription was cancelled by an API call, or at the customer's bank.

Origin Scheme Reason code Consequences
api - Mandate cancelled, subscription cancelled
bank bacs ADDACS-0 Mandate cancelled, subscription cancelled
bank bacs ADDACS-1 Mandate cancelled, subscription cancelled
bank bacs ARUDD-1 Payment failed, subscription cancelled
bank sepa_core MD01 Payment failed, subscription cancelled
bank sepa_cor1 MD01 Payment failed, subscription cancelled

mandate_expired

The mandate for this subscription expired, because no payments have been collected against it for the dormancy period of your Service User Number. You may use the mandate reinstation endpoint to attempt to set this mandate up again.

| Origin Consequences | | --- || ---- | ---- | ---- | | gocardless Mandate expired, subscription cancelled |

bank_account_closed

The customer's bank account was closed by an API call, or at their bank.

Origin Scheme Reason code Consequences
api - - Bank account disabled, subscription cancelled
bank bacs ADDACS-2 Mandate cancelled, subscription cancelled
bank bacs ADDACS-B Mandate cancelled, subscription cancelled
bank bacs AUDDIS-2 Mandate failed, subscription cancelled
bank bacs AUDDIS-B Mandate failed, subscription cancelled
bank bacs ARUDD-2 Payment failed, subscription cancelled
bank bacs ARUDD-B Payment failed, subscription cancelled
bank sepa_core AC04 Payment failed, subscription cancelled
bank sepa_core MD07 Payment failed, subscription cancelled
bank sepa_cor1 AC04 Payment failed, subscription cancelled
bank sepa_cor1 MD07 Payment failed, subscription cancelled

direct_debit_not_enabled

The customer's bank account does not allows direct debit payments.

Origin Scheme Reason code Consequences
bank bacs AUDDIS-F Mandate failed, subscription cancelled
bank bacs AUDDIS-G Mandate failed, subscription cancelled
bank bacs AUDDIS-N Mandate failed, subscription cancelled
bank sepa_core AC06 Payment failed, subscription cancelled
bank sepa_core AG01 Payment failed, subscription cancelled
bank sepa_cor1 AC06 Payment failed, subscription cancelled
bank sepa_cor1 AG01 Payment failed, subscription cancelled

invalid_bank_details

The bank account details used to set up the mandate for this subscription were incorrect.

Origin Scheme Reason code Consequences
bank bacs ARUDD-5 Payment failed, subscription cancelled
bank bacs ARUDD-Y Payment failed, subscription cancelled
bank bacs AUDDIS-5 Mandate failed, subscription cancelled
bank sepa_core AC01 Payment failed, subscription cancelled
bank sepa_cor1 AC01 Payment failed, subscription cancelled

bank_account_transferred

The customer asked their bank to transfer this mandate to another account, but their bank failed to tell GoCardless the details of the new account, so the mandate has been cancelled.

Origin Scheme Reason code Consequences
bank bacs ADDACS-3 Mandate cancelled, subscription cancelled
bank bacs ADDACS-C Mandate cancelled, subscription cancelled
bank bacs AUDDIS-3 Mandate failed, subscription cancelled
bank bacs AUDDIS-C Mandate failed, subscription cancelled

authorisation_disputed

The customer disputes authorising the mandate for this subscription.

Origin Scheme Reason code Consequences
bank bacs ADDACS-D Mandate cancelled, subscription cancelled
bank bacs DDICA-3 Payment charged back, subscription cancelled
bank bacs DDICA-4 Payment charged back, subscription cancelled
bank sepa_core MD01 Payment charged back, subscription cancelled
bank sepa_cor1 MD01 Payment charged back, subscription cancelled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment