---
title: "Bank Direct Debit"
source_url: https://docs.rapyd.net/en/bank-direct-debit.html
lang: en
---

# Bank Direct Debit

Withdraw funds from your customers’ bank accounts.

Bank [direct debit](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_direct_debit "Direct debit") is an authorized withdrawal from your customer's bank account. Direct debits are typically used in recurring transactions such as bill payments, memberships and subscriptions. Direct debit functionality is only available in select countries where the capability exists as part of a banking network.

Popular direct debit capable schemes include:

- [Bacs](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_bacs "Bankers' Automated Clearing Services") in the UK.
- [ACH](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_ach "Automated Clearing House") in the US.
- BECs in Australia.
- GIRO in Singapore.
- [SEPA](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_sepa "Single Euro Payments Area") in the EU. See List of SEPA Supported Countries (You must be domiciled here in order to accept SEPA payments)

  Andorra, Austria, Belgium, Bulgaria, Cypress, Czech Republic, Denmark, Estonia, Finland, France, Germany, Gibraltar, Greece, Holy See, Hungary, Ireland, Iceland, Italy, Liechtenstein, Lithuania, Luxembourg, Monaco, Malta, Netherlands, Norway, Poland, Portugal, Romania, San Marino, Spain, Slovenia, Slovakia, Sweden, Switzerland

The direct debit process below explains how to:

- Add direct debit payments to your business workflow.
- Create direct debit payment request.
- Capture the payment response.

> **Note:**
>
> Participants in the Rapyd Network are subject to the [Rapyd Network Rules](https://www.rapyd.net/networkrules/). Any use of or participation of the Rapyd Network not covered in the Rapyd Network Rules will be governed by applicable participation agreements and associated documentation.

### Bank Direct Debit Checkout

The following example represents an ACH Direct Debit checkout page workflow.

> **Note:**
>
> Your customer must sign a proof of authorization form that complies with Rapyd's ACH network rules. For more information, see section 13 - Web Initiated ACH Entries of [Rapyd Network Rules](https://www.rapyd.net/networkrules/). You must maintain a copy of this form in your records.

1. Enter your account information.
2. Click **Place Your Order**.

   ![6480836ea645b.png](image/img-04a0cb67c91234aa8a41dfd2e14c2d3c.png)
3. Follow the payment instructions to complete the payment.
4. Click **Finish**.

   ![64808371849b9.png](image/img-577d4b7192e21384c37d543f769dcec9.png)

### Bank Direct Debit Workflow

Finding the specific bank direct debit payment methods you'll accept and the corresponding required fields that customers fill out is described under How it Works.

### First Time SEPA Mandate Process Request

![first-time-sepa.jpg](image/img-016459530a4c90449ac35a59983027d4.jpg)

1. Customer selects SEPA payment.
2. You ask Rapyd to process request.
3. Rapyd processes the request and sends the [redirect URL](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_redirect "Redirect URL").
4. You present the redirect URL to customer.
5. Customer signs the SEPA mandate.

### Process Payment Request

![process-sepa.jpg](image/img-5fb7e2d54fdf8ab8a5d2e27f4ddb96e6.jpg)

1. Customer completes the ACH bank transfer payment.
2. Your website back end asks Rapyd to process the ACH bank transfer payment.
3. Rapyd processes the payment and responds with details of the transaction.
4. The website back end is notified by Rapyd when the payment is completed successfully.

### How Bank Direct Debit Works

### Find Available Payment Methods

Decide the bank direct debit payment methods you will accept, so your customer can specify their payment methods on your payment page. To do that, use [List Payment Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") with the following parameters:

- Available countries can be listed with the [List Countries](https://docs.rapyd.net/en/list-countries.md "List Countries") API call.
- For illustration purposes, we will use **US** and **USD** for country and currency in the sample codes below. US ACH is the direct debit payment type.

Description of Query Parameters

| Query Parameter | Description |
| --- | --- |
| country | Enter **US** as the ISO ALPHA-2 country code country code for the United States. |
| currency | Enter **USD** as the currency code for United States dollars. |

- - Request

    - ```
      // Request URL: GET https://sandboxapi.rapyd.net/v1/payment_methods/country?country=US&currency=USD

      // Message body absent
      ```
- - .NET Core

    - ```
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string country = "US";
                      string currency = "USD";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/payment_methods/country?country={country}&currency={currency}");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest('GET', '/v1/payment_methods/country?country=US&currency=USD');

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```

      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('get', '/v1/payment_methods/country?country=US&currency=USD');
          var_dump($object);
      } catch (Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```
      from pprint import pprint

      from utilities import make_request

      country = 'US'
      currency = 'USD'
      results = make_request(method='get',
                             path=f'/v1/payment_methods/country?country={country}&currency={currency}')
      pprint(results))
      ```

### List Payment Methods by Country Response

[List Payments Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "90ebf1ec-9e40-49f6-9175-b3a764ab3cd0"
          },
          "data": [
              {
                  "type": "us_ach_bank",
                  "name": "Evolve Bank & Trust ",
                  "category": "bank_transfer",
                  "image": "https://iconslib.rapyd.net/checkout/us_ach_bank.png",
                  "country": "us",
                  "payment_flow_type": "bank_transfer",
                  "currencies": [
                      "USD"
                  ],
                  "status": 1,
                  "is_cancelable": false,
                  "payment_options": [],
                  "is_expirable": false,
                  "is_online": false,
                  "minimum_expiration_seconds": null,
                  "maximum_expiration_seconds": null
              }
          ]
      }
      ```

The `data` section of this response shows that **us_ach_bank** is a supported payment method.

> **Note:**
>
> A full API response lists many payment methods.

### Find Required Fields for the Payment Method

Identify the fields that your customer needs to complete for the payment method. To do that, use [Get Payment Method Required Fields](https://docs.rapyd.net/en/get-payment-method-required-fields.md "Get Payment Method Required Fields") with the following parameter:

Description of Path Parameters

| Path Parameter | Description |
| --- | --- |
| type | Enter **us_ach_bank** as the payment method type. |

### Get Payment Method Required Fields Request

Request a set of required fields for a **us_ach_bank**  payment.

- - Request

    - ```
      // Request URL: GET https://sandboxapi.rapyd.net/v1/payment_methods/us_ach_bank/required_fields

      // Message body absent
      ```
- - .NET Core

    - ```
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string type = "us_ach_bank";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/payment_methods/{type}/required_fields");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest('GET', '/v1/payment_methods/us_ach_bank/required_fields');

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('get', '/v1/payment_methods/us_ach_bank/required_fields');
          var_dump($object);
      } catch (Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```
      from pprint import pprint

      from utilities import make_request

      payment_method = 'us_ach_bank'
      results = make_request(method='get',
                             path=f'/v1/payment_methods/us_ach_bank/required_fields')
      pprint(results)
      ```

### Get Payment Method Required Fields Response

[Get Payment Method Required Fields](https://docs.rapyd.net/en/get-payment-method-required-fields.md "Get Payment Method Required Fields") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "058bc78e-49aa-4370-b0b4-3635950173ac"
          },
          "data": {
              "type": "us_ach_bank",
              "fields": [
                  {
                      "name": "proof_of_authorization",
                      "type": "boolean",
                      "regex": "",
                      "description": "",
                      "is_required": true,
                      "is_updatable": false
                  },
                  {
                      "name": "first_name",
                      "type": "string",
                      "regex": "",
                      "description": "",
                      "is_required": false,
                      "is_updatable": false
                  },
                  {
                      "name": "last_name",
                      "type": "string",
                      "regex": "",
                      "description": "",
                      "is_required": false,
                      "is_updatable": false
                  },
                  {
                      "name": "company_name",
                      "type": "string",
                      "regex": "",
                      "description": "",
                      "is_required": false,
                      "is_updatable": false
                  },
                  {
                      "name": "routing_number",
                      "type": "string",
                      "regex": "^([0-9]){9,9}$",
                      "description": "",
                      "is_required": true,
                      "is_updatable": false
                  },
                  {
                      "name": "payment_purpose",
                      "type": "string",
                      "regex": "(PAYMENT|VENDOR PMT)",
                      "description": "",
                      "is_required": true,
                      "is_updatable": false
                  },
                  {
                      "name": "account_number",
                      "type": "string",
                      "regex": "^([0-9]){1,34}$",
                      "description": "",
                      "is_required": true,
                      "is_updatable": false
                  }
              ],
              "payment_method_options": [],
              "payment_options": [],
              "minimum_expiration_seconds": null,
              "maximum_expiration_seconds": null
          }
      }
         
      ```

The `data` section of this response shows that the following fields are required for a **us_ach_bank** payment:

- proof_of_authorization
- routing_number
- payment_purpose
- account_number

The following fields are optional:

- first_name
- last_name
- company_name

### Create a Bank Transfer Payment

When your customer pays a loan on your website, create a request called [Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment"), using the following parameters, for Rapyd to process the ACH bank transfer payment:

Description of Body Parameters

| Body Parameter | Description |
| --- | --- |
| amount | Enter **2100** as the payment amount. |
| currency | Enter **USD** as the currency code for US dollars. |
| payment_method | Enter an object with the following fields:  - `type` - **us_ach_bank** - `proof_of_authorization` - **true**. (Indicates that your customer filled in a proof of authorization form for the bank). - `first_name` - **Test** - `last_name` - **User** - `company_name` - **Acme** - `routing_number` -  **123UA34599** - `payment_purpose` - **Loan payment** - `account_number` -  **USA_2340234-098-0908g** |

### Create Payment Request

Request Rapyd to process your customer's payment (of 2,100.00 USD) as an ACH bank transfer.

- - Request

    - ```
      // Request URL: POST https://sandboxapi.rapyd.net/v1/payments

      // Message body: 
      {
          "amount": 2100,
          "currency": "USD",
          "payment_method": {
              "type": "us_ach_bank",
              "fields": {
                  "proof_of_authorization": true,
                  "first_name": "Test",
                  "last_name": "User",
                  "company_name": "Acme",
                  "routing_number": "123UA34599",
                  "payment_purpose": "Loan payment",
                  "account_number": "USA_2340234-098-0908g"
              }
          }
      }
      ```
- - .NET Core

    - ```
      using System;
      using System.Text.Json;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      var requestObj = new
                      {
                          amount = 2100,
                          currency = "USD",
                          payment_method = new
                          {
                              type = "us_ach_bank",
                              fields = new
                              {
                                  proof_of_authorization = true,
                                  first_name = "Test",
                                  last_name = "User",
                                  company_name = "Acme",
                                  routing_number = "123UA34599",
                                  payment_purpose = "Loan payment",
                                  account_number = "USA_2340234-098-0908g",
                              }
                          }
                      };

                      string request = JsonSerializer.Serialize(requestObj);

                      string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/payments", request);

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const body = {
            amount: 2100,
            currency: 'USD',
            payment_method: {
              type: 'us_ach_bank',
              fields: {
                proof_of_authorization: true,
                first_name: 'Test',
                last_name: 'User',
                company_name: 'Acme',
                routing_number: '123UA34599',
                payment_purpose: 'Loan payment',
                account_number: 'USA_2340234to098to0908g'
              }
            }
          };
          const result = await makeRequest('POST', '/v1/payments', body);

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - Python

    - ```
      from pprint import pprint

      from utilities import make_request

      payment_body = {
            "amount": 2100,
            "currency": "USD",
            "payment_method": {
                "type": "us_ach_bank",
                "fields": {
                   "proof_of_authorization": true,
                    "first_name": "Test",
                    "last_name": "User",
                    "company_name": "Acme",
                    "routing_number": "123UA34599",
                    "payment_purpose": "Loan payment",
                    "account_number": "USA_2340234to098to0908g"
              }
            }
          }

      create_payment_response = make_request(method='post',
                                             path='/v1/payments',
                                             body=payment_body)
      pprint(create_payment_response)
      pprint(results)
      ```

### Create Payment Response

[Create Payment](https://docs.rapyd.net/en/create-payment.md "Create Payment") describes the fields in the response.

- - Response

    - ```
      {
          "status": {
              "error_code": "",
              "status": "SUCCESS",
              "message": "",
              "response_code": "",
              "operation_id": "3ae269bc-11ff-477b-9f2a-ce69786876dc"
          },
          "data": {
              "id": "payment_a7ed3e41026614bc9e1d50981c099e07",
              "amount": 0,
              "original_amount": 2100,
              
      //      ...          
                
              "currency_code": "USD",
              "country_code": "us",
              "status": "ACT",

              //      ...

              "customer_token": "cus_722c2234e6f83c5249b5376d743737cc",
              "payment_method": "other_1a06a5f97f4b0ff901d61f3ea704b296",

              //      ...

              "created_at": 1583408200,

              //      ...

              "paid": false,

              //      ...

              "payment_method_type": "us_ach_bank",
              "payment_method_type_category": "bank_transfer",

              //      ...

          }
      }
         
      ```

The `data` section of this response shows:

- The payment `id` is  **payment_a7ed3e41026614bc9e1d50981c099e07**. When you run this in your own sandbox, you will get a different ID, which you will need for a later step.
- The `original_amount` of the payment is **2100**. You will need this value for a later step.
- The `currency_code` is **USD** .
- The `status` is **ACT**. This means that the payment process is active and awaiting completion. [Payment Object](https://docs.rapyd.net/en/payment.md "Payment") lists possible values for `status`.

### Close the Transaction

> **Note:**
>
> The [sandbox](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_sandbox "Sandbox") does not directly simulate the action that completes a payment. You can simulate this action with the procedure described in [Complete Payment](https://docs.rapyd.net/en/complete-payment-363014.md "Complete Payment"). To do that, you will need the following values from the response you received when you ran 'Create Payment' in your sandbox:
>
> - `payment id`
> - `code` (in the `textual_codes` object)
> - `original_amount`
>
> When a payment is completed, Rapyd sends a webhook. Before you run 'Complete Payment', configure your system to receive webhooks with the procedure described in [Defining a Webhook Endpoint](https://docs.rapyd.net/en/defining-a-webhook-endpoint.md "Defining a Webhook Endpoint") .

After you simulate the transfer of funds by your customer's bank, Rapyd sends you a webhook [Webhook - Payment Completed](https://docs.rapyd.net/en/payment-completed-webhook.md "Payment Completed Webhook") to confirm that the payment was completed.
