# Bacs Direct Debit for API only Before you start, you must have a Service User Number (SUN) set up for your account. To enable Bacs Direct Debit payments, contact your account manager or [request support](https://dashboard.checkout.com/support/new?topic=case_account_management_and_access&issue=issue_account_changes). To process a Bacs Direct Debit payment: 1. Set up the Direct Debit Instruction, which includes account validation. 2. Send a pre-notification to your customer. 3. Request a payment. ## Set up the Direct Debit Instruction To set up a Direct Debit Instruction, call the [Create an instrument](https://api-reference.checkout.com/#operation/createAnInstrument) endpoint. This action validates your customer's bank details and, if successful, creates the mandate with the Bacs scheme. > **Information** > > A Bacs mandate typically becomes active within five business days of creation. You cannot collect a payment against the mandate during this period. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/instruments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/instruments` You must provide your customer's bank details and account holder information. The `bank_code` field is the UK sort code. When you verify the instrument, we check the `first_name` and `last_name` provided in `account_holder` against the bank account details provided in `account_number` and `bank_code`: - If the details match, we automatically create the mandate and return a `201 Created` response. - If the details partially match, we return a `422` error to warn you of a discrepancy, and share the suggested name where available. Add `"allowPartialMatch": true` to your request to bypass the validation warning and create the mandate anyway. - If the details do not match, we return a `422` error to warn you of a discrepancy. ### Request example ```json { "type": "bacs", "instrument_data": { "account_number": "31392621", "bank_code": "609242", "currency": "GBP", "country": "GB", "allow_partial_match": true }, "account_holder": { "first_name": "Toby", "last_name": "Arden", "type": "individual", "email": "toby.arden@example.com" }, "account": { "processing_channel_id": "pc_ovo75iz4hdyudnx6tu74mum3fq" } } ``` ### Response example ```json { "type": "bacs", "id": "src_wmlfc3zyhqzehihu7giusaaawu", "fingerprint": "vnsdrvikkvre3dtrjjvlm5du4q" } ``` The `id` returned represents the saved instrument containing your mandate ID. You must provide this ID when you [request a Bacs Direct Debit payment](#Request_a_payment). You can retrieve a mandate by calling the following endpoints: **Production** `GET` `https://{prefix}.api.checkout.com/instruments/{id}` `DELETE` `https://{prefix}.api.checkout.com/instruments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/instruments/{id}` `DELETE` `https://{prefix}.api.sandbox.checkout.com/instruments/{id}` --- ## Send a pre-notification After you set up the Direct Debit Instruction, call the pre-notification endpoint to send your customer an advance notice email before you collect the payment. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/apms/bacs/notifications` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/apms/bacs/notifications` ### Request example ```json { "source_id": "src_wmlfc3zyhqzehihu7giusaaawu", "notification_type": "advance_notice", "collection_date": "2026-10-20", "amount": 45999, "currency": "GBP", "customer_email": "toby.arden@example.com", "reference": "ORDER_01234", "billing_descriptor": "CHECKOUT RE TEST PAYMENT", "support_email": "support@example.com", "support_phone": "+44 1234 567890" } ``` --- ## Request a payment To request a payment, call the [Request a payment](https://api-reference.checkout.com/#operation/requestAPaymentOrPayout) endpoint. Set `source.type` to `id` and provide the instrument ID returned when you set up the Direct Debit Instruction, along with the mandate reference. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "id", "id": "src_wmlfc3zyhqzehihu7giusaaawu" }, "amount": 2500, "currency": "GBP", "reference": "ORDER_01234", "processing_channel_id": "pc_ovo75iz4hdyudnx6tu74mum3fq", "customer": { "id": "cus_ru2v6vjljcgu5t4iaxrb6pjhno" }, "processing": { "mandate_reference": "MANDATE-001" } } ``` ### Response example If you receive a `201 Created` response with a status field set to `Pending`, the payment has been initiated against the mandate. ```json { "id": "pay_er3uvjvfgpauje7o64agv3damy", "status": "Pending", "reference": "ORDER_01234", "customer": { "id": "cus_ru2v6vjljcgu5t4iaxrb6pjhno", "name": "Toby Arden" }, "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_er3uvjvfgpauje7o64agv3damy" } } } ``` --- ## Refund a payment You can partially or fully refund a payment through the [Dashboard](https://dashboard.checkout.com/) or the [Refund API](https://api-reference.checkout.com/#operation/refundAPayment) if both of the following conditions are true: - It's been seven or more days since the original payment date. - The payment status is `captured`. When you request a refund, you receive a `payment_refund_pending` webhook. > **Information** > > If you plan to issue a refund, communicate this to the customer to prevent them from simultaneously canceling the payment with their bank. If the customer is credited twice, contact them directly to resolve the situation. If the refund is successfully sent and accepted by the Bacs Direct Debit scheme, you receive a `payment_refunded` webhook, and the payment status changes to `refunded` or `partially_refunded`. If the refund is declined by the Bacs Direct Debit scheme or the customer's bank, you receive a `payment_refund_declined` webhook.