Direct Debit BACS

Overview

Introduction

Direct Debit BACS is a payment method which allows you to process payments in pounds by using bank accounts in the UK. This method supports COF purchases and refunds.

This article provides information about working with the Direct Debit BACS method: general insights are presented in the Overview section, while information about the actions required to process payments and perform other actions is presented in the sections that follow.

General information

Payment method type bank payments
Payment instruments bank accounts
Countries and regions GB
Payment currencies GBP
Currency conversion
One-time purchases
Credential-on-file purchases +
Full refunds +
Partial refunds +
Payouts
Chargebacks
Notes by default refunds can be performed only after seven calendar days since the purchase has been processed; to enable the possibility of performing refunds before this time, contact your ecommpay account manager
Onboarding and access fee refer to your ecommpay account manager

Interaction diagram

Payment processing by using the Direct Debit BACS method involves the merchant's web service, one of ecommpay interfaces, the ecommpay payment platform, and technical facilities of the provider service.

Operations support

Various platform interfaces can be used to process payments and perform operations using the Direct Debit BACS method. Purchases can be processed by using Payment Page, Gate and Dashboard (using payment links), refunds—by using Gate and Dashboard.

The threshold time for processing purchases (the maximum possible time between the moment a payment is initiated in the payment platform and the moment the web service receives the callback with the payment result information) is 5 banking days. A payment is automatically assigned the decline status if it wasn't processed within the threshold time.

Processing scenarios

To perform a purchase by using the Direct Debit BACS method, you need to redirect the customer to the Direct Debit BACS service, while to make a refund, you need to receive a request from the customer and notify the customer about the result of the refund via the web service.

COF purchases by using Payment Page

General information

When using Payment Page and the Direct Debit BACS method, you can register COF purchases of two types:

  • Regular purchase—regular automatic debits are carried out according to a schedule passed to the platform (details). In this case, automatic debiting is used, without additional actions on the part of the merchant.
  • Autopurchase—debits are initiated by the web service by sending requests based on specified rules (details). In this case, to debit funds, each time a separate Gate request is required (details).

At the same time, you can register a COF purchase of any of these types either with or without an initial debit of funds. Please note that for registration without the initial debit the directdebit payment type is used, and for registration with the first debit the purchase type is used.

To register a COF purchase through Payment Page by using the Direct Debit BACS method, the merchant's web service is required to send a request with all required parameters and signature to the ecommpay URL and receive a callback with the registration result.

Information about the formats of requests and callbacks used for registering purchases by using the Direct Debit BACS method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in Interaction concepts.

Request format for registration without the initial debit of funds

When registering a COF purchase without the initial debit, the directdebit payment type is used, within which the following types of operations can be performed: contract registration, recurring update (only when for regular purchases), recurring cancel (only for regular purchases). There are several things you need to consider when sending purchase registration requests by using the Direct Debit BACS method:

  1. The following parameters required for any payment must be specified:
    • project_id—project identifier obtained from ecommpay during integration
    • payment_id—payment identifier unique within the project
    • payment_currency—payment currency code in the ISO-4217 alpha-3 format
    • payment_amount—payment amount, the 0 value must be specified
    • customer_id—customer identifier unique within the project
  2. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. Additionally, it is necessary to specify the first and last names of the customer in the parameters customer_first_name and customer_last_name, as well as the directdebit-bacs method code in the force_payment_method parameter and the card_verify value in the mode parameter.
  4. To register a COF purchase, you must specify a recurring object containing the registration attribute and the necessary information. The Direct Debit BACS method supports two types of COF purchases: U (autopurchase) and R (regular purchase). To register regular payments, the request must contain information about the frequency, amount, and beginning and end time of debits of funds. The full list of parameters that can be specified in the recurring object is presented in the COF purchase registration section.
  5. Additionally, any other parameters available for working with Payment Page can be used (details).
  6. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Direct Debit BACS method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and COF purchase information, as well as signature.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_currency": "GBP",
   "payment_amount": 0,
   "customer_id": "customer1",
   "customer_first_name": "John",
   "customer_last_name": "Doe",
   "recurring": "{"register":true,"type":"R","amount":400,"expiry_day":1,"expiry_month":8,"expiry_year":2025,"interval": 10,"period":"D","time": "10:00:00","start_date":"14-05-2019","scheduled_payment_id":"A2323"}",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}
Figure 1. Example of sufficient data in a request for registration without the initial debit of funds
{
   "project_id": 120,
   "payment_id": "580",
   "payment_currency": "GBP",
   "payment_amount": 0,
   "customer_id": "customer1",
   "customer_first_name": "John",
   "customer_last_name": "Doe",
   "recurring": "{"register":true,"type":"R","amount":400,"expiry_day":1,"expiry_month":8,"expiry_year":2025,"interval": 10,"period":"D","time": "10:00:00","start_date":"14-05-2019","scheduled_payment_id":"A2323"}",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Request format for registration with the initial debit of funds

When registering a COF purchase with the initial debit, the purchase payment type is used, within which the following types of operations can be performed: sale, reversal, refund, contract registration, recurring update (only for regular purchases) and recurring cancel (only for regular purchases).

There are several things you need to consider when sending purchase registration requests by using the Direct Debit BACS method:

  1. The following parameters required for any payment must be specified:
    • project_id—project identifier obtained from ecommpay during integration
    • payment_id—payment identifier unique within the project
    • payment_currency—payment currency code in the ISO-4217 alpha-3 format
    • payment_amount—payment amount in the smallest currency unit
    • customer_id—customer identifier unique within the project
  2. The following parameters required for any payment must be specified: project_id, payment_id, payment_currency, payment_amount, customer_id.
  3. Additionally, it is necessary to specify the first and last names of the customer in the parameters customer_first_name and customer_last_name.
  4. To register a COF purchase, you must specify a recurring object containing the registration attribute and the necessary information. The Direct Debit BACS method supports two types of COF purchases: U (autopurchase) and R (regular purchase). To register regular payments, the request must contain information about the frequency, amount, and beginning and end time of debits of funds. The full list of parameters that can be passed in the recurring object is presented in the COF purchase registration section.
  5. If you need to have the payment form displayed with the Direct Debit BACS method selected, set the force_payment_method parameter to directdebit-bacs.
  6. Additionally, any other parameters available for working with Payment Page can be used (details).
  7. After all target parameters are specified, generate a signature (details).

Thus, a correct request for opening the payment form using the Direct Debit BACS method must contain the project identifier, basic payment information (identifier, amount, and currency code), customer and COF purchase information, as well as signature.

{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "GBP",
   "customer_id": "customer1",
   "customer_first_name": "John",
   "customer_last_name": "Doe",
   "recurring": "{"register":true,"type":"R","amount":400,"expiry_day":1,"expiry_month":8,"expiry_year":2025,"interval": 10,"period":"D","time": "10:00:00","start_date":"14-05-2019","scheduled_payment_id":"A2323"}",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}
Figure 2. Example of sufficient data in a request for registration with the initial debit of funds
{
   "project_id": 120,
   "payment_id": "580",
   "payment_amount": 1000,
   "payment_currency": "GBP",
   "customer_id": "customer1",
   "customer_first_name": "John",
   "customer_last_name": "Doe",
   "recurring": "{"register":true,"type":"R","amount":400,"expiry_day":1,"expiry_month":8,"expiry_year":2025,"interval": 10,"period":"D","time": "10:00:00","start_date":"14-05-2019","scheduled_payment_id":"A2323"}",
   "signature": "kUi2x9dKHAVNU0FYldOcZzUCwX6R\/ekpZhkIQg=="
}

Callback format

The Direct Debit BACS method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a COF purchase without an initial debit of funds that has been registered in the 430716 project.

Figure 3. Example of callback data indicating that the purchase has been registered without an initial debit of funds
{
        "project_id": 430716,
        "payment": {
            "id": "ORDER_ID_342011450",
            "type": "directdebit",
            "status": "success",
            "date": "2024-01-19T07:55:49+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 1,
                "currency": "GBP"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "recurring": {
            "id": 9738,
            "currency": "GBP",
            "valid_thru": "2034-01-31T23:59:59+0000"
        },
        "operation": {
            "id": 2048000011083,
            "type": "contract registration",
            "status": "success",
            "date": "2024-01-19T07:55:49+0000",
            "created_date": "2024-01-19T07:54:38+0000",
            "request_id": "881f81f7cd8e1a11b0903a8d8f98-00002049",
            "sum_initial": {
                "amount": 1,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 1,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 21153,
                "payment_id": "K4vshmZkpqPMEHr",
                "auth_code": ""
            }
        },
        "signature": "bepC/BLdBruEdA/1pqB4aJ4KnihVW0pfWM7Y1uAw=="
    }

The following is the example of a callback with information about a COF purchase with an initial debit of funds that has been registered in the 430716 project.

Figure 4. Example of callback data indicating that the purchase has been registered with an initial debit of funds
 {
        "project_id": 430716,
        "payment": {
            "id": "ORDER_ID_702917140",
            "type": "purchase",
            "status": "success",
            "date": "2024-01-18T12:39:38+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 10000,
                "currency": "GBP"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "recurring": {
            "id": 8224,
            "currency": "GBP",
            "valid_thru": "2034-01-31T23:59:59+0000"
        },
        "operation": {
            "id": 2330000011063,
            "type": "contract registration",
            "status": "success",
            "date": "2024-01-18T12:39:38+0000",
            "created_date": "2024-01-18T12:39:37+0000",
            "request_id": "5f3e8be0ed6967412c89beab965-00002331",
            "sum_initial": {
                "amount": 10000,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 21153,
                "payment_id": "ZOrsGv5u8fyQ4SM",
                "auth_code": ""
            }
        },
        "signature": "vdTeWodANtRGz80gHPeI+oyYioNu7T/YISzA=="
    }

The following is the example of a callback with information about a declined registration of a COF purchase.

Figure 5. Example of callback data indicating that the COF purchase has been not been registered
 {
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "test_bacs",
            "type": "directdebit",
            "status": "decline",
            "date": "2024-02-26T11:10:04+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 0,
                "currency": "GBP"
            },
            "description": ""
        },
        "operation": {
            "sum_initial": {
                "amount": 0,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 0,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "MD000ZBRK2P769",
                "auth_code": ""
            },
            "id": 51271010116645,
            "type": "contract registration",
            "status": "decline",
            "date": "2024-02-26T11:10:04+0000",
            "created_date": "2024-02-26T10:54:33+0000",
            "request_id": "741a4d68a1f039c794e309063c4dd-00051272"
        },
        "signature": "+mPKi+A2RMCU7e2S+vXDIUoQzk9rkbwq4dE/xQ=="
    }

The following is the example of a callback with information about a declined registration of a COF purchase and a declined purchase.

Figure 6. Example of callback data indicating that the COF purchase has been not been registered and the purchase has been declined
{
        "customer": {
            "id": "customer 1"
        },
        "project_id": 59051,
        "payment": {
            "id": "TEST_PAYMENT_246302",
            "type": "purchase",
            "status": "awaiting customer",
            "date": "2024-02-26T10:46:12+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 100,
                "currency": "GBP"
            },
            "description": "TEST_PAYMENT_246302"
        },
        "operation": {
            "sum_initial": {
                "amount": 100,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 100,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "PM009FAY0JJF1G",
                "auth_code": ""
            },
            "id": 63155010115589,
            "type": "sale",
            "status": "decline",
            "date": "2024-02-26T10:46:12+0000",
            "created_date": "2024-02-26T10:45:21+0000",
            "request_id": "35ed3b53c8101de9bacb8601f9cbe2633c56917968e-00063156"
        },
        "signature": "0nENQAYq+xYe5MxS2Qsend4Lt0EPPTpcXfPZdbg5p7WH4ZA=="
    }

Useful links

The following articles can be useful when implementing purchases via Payment Page:

COF purchases by using Gate

General information

When using Gate and the Direct Debit BACS method, you can register COF purchases of two types:

  • Regular purchase—regular automatic debits are carried out according to a schedule passed to the platform (details). In this case, automatic debiting is used, without additional actions on the part of the merchant.
  • Autopurchase—debits are initiated by the web service by sending requests based on specified rules (details). In this case, to debit funds, each time a separate request is required.

At the same time, you can register a COF purchase of any of these types either with or without an initial debit of funds. Please note that for registration without the initial debit the directdebit payment type is used, and for registration with the first debit the purchase type is used.

To register a purchase through Gate by using the Direct Debit BACS method, the merchant's web service is required to do the following:

  1. Send a request with all the required parameters and signature to the ecommpay URL.
  2. Receive an intermediate callback from the payment platform and redirect the customer to the Direct Debit BACS service.
  3. Receive the callback from the payment platform informing about the registration result.

To perform each debit of funds within an autopurchase the merchant's web service is required to send a request with all the required parameters and signature to the ecommpay URL and receive a callback from the payment platform informing abot the debit result.

Information about the formats of requests and callbacks used for processing payments by using the Direct Debit BACS method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Request format for registration without the initial debit of funds

When registering a COF purchase without the initial debit, the directdebit payment type is used, within which the following types of operations can be performed: contract registration, recurring update (only when for regular purchases), recurring cancel (only for regular purchases). There are several things you need to consider when sending purchase registration requests by using the Direct Debit BACS method:

  1. To register each purchase, send a separate POST request to the /v2/payment/directdebit/bacs/contract/registration endpoint. This endpoint belongs to the group /v2/payment/directdebit/{payment_method}/contract/registration.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
      • first_name—customer first name
      • last_name—customer last name
  3. To register a COF purchase, you must specify a recurring object containing the registration attribute and the necessary information. The Direct Debit BACS method supports two types of COF purchases: U (autopurchase) and R (regular purchase). To register regular payments, the request must contain information about the frequency, amount, and beginning and end time of debits of funds. The full list of parameters that can be specified in the recurring object is presented in the Registering COF purchase section.
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase registration request by using the Direct Debit BACS method must contain the project identifier, basic payment information (identifier and currency code), customer and COF purchase information, as well as signature.

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "currency": "GBP"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0",
    "first_name": "John",
    "last_name": "Doe"
  },
  "recurring": {
      "type": "R",
      "period": "W",
      "interval": 3,
      "expiry_year": 2025,
      "expiry_month": 5,
      "expiry_day": 5,
      "time": "10:00:00",
      "register": true,
      "scheduled_payment_id": "567891",
      "start_date": "10-10-2020"
  }
}
Figure 7. Example of sufficient data in a request for registration without the initial debit of funds
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "currency": "GBP"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0",
    "first_name": "John",
    "last_name": "Doe"
  },
  "recurring": {
      "type": "R",
      "period": "W",
      "interval": 3,
      "expiry_year": 2025,
      "expiry_month": 5,
      "expiry_day": 5,
      "time": "10:00:00",
      "register": true,
      "scheduled_payment_id": "567891",
      "start_date": "10-10-2020"
  }
}

Request format for registration with the initial debit of funds

When registering a COF purchase with the initial debit, the purchase payment type is used, within which the following types of operations can be performed: sale, reversal, refund, contract registration, recurring update (only for regular purchases) and recurring cancel (only for regular purchases). There are several things you need to consider when sending purchase registration requests by using the Direct Debit BACS method:

  1. To register each purchase, send a separate POST request to the /v2/payment/directdebit/bacs/sale endpoint. This endpoint belongs to the group /v2/payment/directdebit/{payment_method}/sale.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payment amount in the smallest currency unit
      • currency—payment currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • id—customer identifier unique within the project
      • ip_address—customer IP address relevant for the initiated payment
      • first_name—customer first name
      • last_name—customer last name
  3. To register a COF purchase, you must specify a recurring object containing the registration attribute and the necessary information. The Direct Debit BACS method supports two types of COF purchases: U (autopurchase) and R (regular purchase). To register regular payments, the request must contain information about the frequency, amount, and beginning and end time of debits of funds. The full list of parameters that can be specified in the recurring object is presented in the Registering COF purchase section.
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase registration request by using the Direct Debit BACS method must contain the project identifier, basic payment information (identifier, amount and currency code), customer and COF purchase information, as well as signature.

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "GBP"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0",
    "first_name": "John",
    "last_name": "Doe"
  },
  "recurring": {
      "type": "R",
      "period": "W",
      "interval": 3,
      "expiry_year": 2025,
      "expiry_month": 5,
      "expiry_day": 5,
      "time": "10:00:00",
      "register": true,
      "scheduled_payment_id": "567891",
      "start_date": "10-10-2020"
  }
}
Figure 8. Example of sufficient data in a request for registration with the initial debit of funds
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "amount": 1000,
    "currency": "GBP"
  },
  "customer": {
    "id": "customer123",
    "ip_address": "192.0.2.0",
    "first_name": "John",
    "last_name": "Doe"
  },
  "recurring": {
      "type": "R",
      "period": "W",
      "interval": 3,
      "expiry_year": 2025,
      "expiry_month": 5,
      "expiry_day": 5,
      "time": "10:00:00",
      "register": true,
      "scheduled_payment_id": "567891",
      "start_date": "10-10-2020"
  }
}

Request format for a separate debit of funds

There are several things you must consider when sending requests for separate debits of funds by using the Direct Debit BACS method:

  1. To perform each debit, send a separate POST request to the /v2/payment/directdebit/bacs/recurring endpoint. This endpoint belongs to the group /v2/payment/directdebit/{payment_method}/recurring.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object payment—payment information:
      • amount—payout amount in the smallest currency unit
      • currency—payout currency code in the ISO-4217 alpha-3 format
    • Object customer—customer information:
      • ip_address—customer IP address relevant for the initiated payout
    • Object recurring—COF purchase information:
      • id—registered COF purchase identifier
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct request for a separate debit of funds by using the Direct Debit BACS method must contain the project and COF purchase identifiers, customer and payment information, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==",
  },
  "customer": {
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "GBP"
  },
  "recurring": {
    "id": 1234567890
  }
}
Figure 9. Example of sufficient data in a request for a separate debit of funds
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==",
  },
  "customer": {
    "ip_address": "192.0.2.0"
  },
  "payment": {
    "amount": 1000,
    "currency": "GBP"
  },
  "recurring": {
    "id": 1234567890
  }
}

Request format for getting information about a debiting series

There are several things you must consider when sending a request for information about a debiting series by using the Direct Debit BACS method:

  1. To request information each time send a separate POST request to the /v2/payment/recurring/info endpoint.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object recurring—COF purchase information:
      • id—registered COF purchase identifier
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct request for information by using the Direct Debit BACS method must contain the project, payment and COF purchase identifiers, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}
Figure 10. Example of sufficient data in a request for information
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}

Request format for updating a debiting series

There are several things you must consider when updating a debiting series by using the Direct Debit BACS method:

  1. For each update send a separate POST request to the /v2/payment/directdebit/bacs/recurring/update endpoint. This endpoint belongs to the group /v2/payment/directdebit/{payment_method}/recurring/update.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object recurring—COF purchase information:
      • id—registered COF purchase identifier
  3. You need also use other parameters of the recurring object:
    • expiry_year—expiration year of the COF purchase
    • expiry_month—expiration month of the COF purchase
    • expiry_day—expiration day of the COF purchase
    • interval—multiplicator to increase debiting period, for example if you need to run debiting every third week, you can set period to W and interval to 3. Possible values: from 1 to 100
    • amount—amount to debit after registration
    • scheduled_payment_id—ID to assign the COF purchase (for automatic debiting)
    • period—debiting period:
      • D—daily
      • W—weekly
      • M—monthly
      • Q—quarterly
      • Y—yearly
    • time—time of subsequent debiting in the hh:mm:ss format
    • start_date—date to perform the first debit
  4. Additionally, any other parameters included in the specification can be used.

Thus, a correct update request by using the Direct Debit BACS method must contain project ID, payment ID, signature, ID of debit series, and debit series parameters to update.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890,
    "interval":3,
    "period":"M",
    "time":"12:00:00"
  }
}
Figure 11. Example of sufficient data in a COF purchase update request
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890,
    "interval":3,
    "period":"M",
    "time":"12:00:00"
  }
}

Request format for cancelling a COF purchase

There are several things you must consider when cancelling COF purchases by using the Direct Debit BACS method:

  1. To cancel each purchase, send a separate POST request to the /v2/payment/directdebit/bacs/recurring/cancel endpoint. This endpoint belongs to the group /v2/payment/directdebit/{payment_method}/recurring/cancel.
  2. Each request must include the following objects and parameters:
    • Object general—general purchase information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_id—payment identifier unique within the project
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification) (details)
    • Object recurring—COF purchase information:
      • id—registered COF purchase identifier
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct purchase request by using the Direct Debit BACS method must contain the project, payment and COF purchase identifiers, as well as signature.

 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}
Figure 12. Example of sufficient data in a COF purchase cancellation request
 {
  "general": {
    "project_id": 208,
    "payment_id": "TEST_15427007172789",
    "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==",
  },
  "recurring": {
    "id": 1234567890
  }
}

Formats of intermediate callbacks for customer redirection

Each payment made with the Direct Debit BACS method requires redirection of customers from the merchant's web service to the Direct Debit BACS service. To redirect a customer it is necessary to receive an intermediate callback from the payment platform and use the information included in the redirect_data object. The format of such callbacks is standard (details), and the following objects and parameters are included in the redirect_data object:

  • body—object with data to be sent in the request body
  • method—parameter specifying the HTTP method for sending the request (GET or POST)
  • url—parameter containing a link for redirection
Figure 13. redirect_data example
  "redirect_data": {
    "body": {},
    "method": "GET",
    "url": "https://www.example.com/pay"
  }

Callback format

The Direct Debit BACS method uses the standard format for callbacks to deliver purchase results. For more information, see Callbacks.

The following is the example of a callback with information about a COF purchase without an initial debit of funds that has been registered in the 430716 project.

Figure 14. Example of callback data indicating that the purchase has been registered without an initial debit of funds
{
        "project_id": 430716,
        "payment": {
            "id": "ORDER_ID_342011450",
            "type": "directdebit",
            "status": "success",
            "date": "2024-01-19T07:55:49+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 1,
                "currency": "GBP"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "recurring": {
            "id": 9738,
            "currency": "GBP",
            "valid_thru": "2034-01-31T23:59:59+0000"
        },
        "operation": {
            "id": 2048000011083,
            "type": "contract registration",
            "status": "success",
            "date": "2024-01-19T07:55:49+0000",
            "created_date": "2024-01-19T07:54:38+0000",
            "request_id": "881f81f7cd8e1a11b0903a8d8f98-00002049",
            "sum_initial": {
                "amount": 1,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 1,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 21153,
                "payment_id": "K4vshmZkpqPMEHr",
                "auth_code": ""
            }
        },
        "signature": "bepC/BLdBruEdA/1pqB4aJ4KnihVW0pfWM7Y1uAw=="
    }

The following is the example of a callback with information about a COF purchase with an initial debit of funds that has been registered in the 430716 project.

Figure 15. Example of callback data indicating that the purchase has been registered with an initial debit of funds
 {
        "project_id": 430716,
        "payment": {
            "id": "ORDER_ID_702917140",
            "type": "purchase",
            "status": "success",
            "date": "2024-01-18T12:39:38+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 10000,
                "currency": "GBP"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "recurring": {
            "id": 8224,
            "currency": "GBP",
            "valid_thru": "2034-01-31T23:59:59+0000"
        },
        "operation": {
            "id": 2330000011063,
            "type": "contract registration",
            "status": "success",
            "date": "2024-01-18T12:39:38+0000",
            "created_date": "2024-01-18T12:39:37+0000",
            "request_id": "5f3e8be0ed6967412c89beab965-00002331",
            "sum_initial": {
                "amount": 10000,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 21153,
                "payment_id": "ZOrsGv5u8fyQ4SM",
                "auth_code": ""
            }
        },
        "signature": "vdTeWodANtRGz80gHPeI+oyYioNu7T/YISzA=="
    }

The following is the example of a callback with information about a declined registration of a COF purchase.

Figure 16. Example of callback data indicating that the COF purchase has been not been registered
 {
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "test_bacs",
            "type": "directdebit",
            "status": "decline",
            "date": "2024-02-26T11:10:04+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 0,
                "currency": "GBP"
            },
            "description": ""
        },
        "operation": {
            "sum_initial": {
                "amount": 0,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 0,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "MD000ZBRK2P769",
                "auth_code": ""
            },
            "id": 51271010116645,
            "type": "contract registration",
            "status": "decline",
            "date": "2024-02-26T11:10:04+0000",
            "created_date": "2024-02-26T10:54:33+0000",
            "request_id": "741a4d68a1f039c794e309063c4dd-00051272"
        },
        "signature": "+mPKi+A2RMCU7e2S+vXDIUoQzk9rkbwq4dE/xQ=="
    }

The following is the example of a callback with information about a separate debit of funds.

Figure 17. Example of callback data indicating that the funds have been debited as a result of a separate debit
{
        "project_id": 430716,
        "payment": {
            "id": "ORDER_ID_494065730",
            "type": "recurring",
            "status": "success",
            "date": "2024-01-24T16:02:17+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 10000,
                "currency": "GBP"
            },
            "description": ""
        },
        "customer": {
            "id": "customer1"
        },
        "recurring": {
            "id": 5768,
            "currency": "GBP",
            "valid_thru": "2034-01-31T23:59:59+0000"
        },
        "operation": {
            "id": 4653000011052,
            "type": "recurring",
            "status": "success",
            "date": "2024-01-24T16:02:17+0000",
            "created_date": "2024-01-24T16:01:49+0000",
            "request_id": "0e716081819385b6448b8c3387c4-00004654",
            "sum_initial": {
                "amount": 10000,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "GBP"
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 21153,
                "payment_id": "a5xCcVqriGOJ8Ty",
                "auth_code": ""
            }
        },
        "signature": "VkmznYWPXQOYOqHyH5SuZRdzLab5GW5RUoe67QqBvw=="
    }

The following is the example of a callback with information about a declined separate debit of funds.

Figure 18. Example of callback data indicating that the separate debit of funds has been declined
{
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "test_001",
            "type": "recurring",
            "status": "scheduled recurring processing",
            "date": "2024-02-16T11:36:37+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 400,
                "currency": "GBP"
            },
            "description": ""
        },
        "recurring": {
            "valid_thru": "2030-01-31T23:59:59+0000",
            "id": 1721154593,
            "currency": "GBP"
        },
        "operation": {
            "sum_initial": {
                "amount": 400,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 400,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "PM009DFXAP3EQR",
                "auth_code": ""
            },
            "id": 76329010120929,
            "type": "recurring",
            "status": "decline",
            "date": "2024-02-16T11:36:37+0000",
            "created_date": "2024-02-16T11:33:44+0000",
            "request_id": "5e19acd1e577f9f35a52c2706f-00076330"
        },
        "signature": "uUUVa/0siyHKibfL+CRo1cshrlVoJhkGoByn1g=="
    }

The following is the example of a callback with information about an updated debiting series.

Figure 19. Example of callback data indicating that the debiting series has been updated
{  
  "project_id":123,
  "recurring":{
    "id":1079,              
    "currency":"GBP",
    "status":"active",       
    "type":"R",
    "expiry_month":"5",    
    "expiry_year":"2025",   
    "period":"M",            
    "period_interval":3,
    "time":"12:00:00"        
  },
  "signature":"IL9tVftZ1ZZ5D/b0VMdeR+YyilUwSm...=="
}

The following is the example of a callback with information about a cancelled COF purchase.

Figure 20. Example of callback data indicating that the COF purchase has been canceled
 {
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "TEST_PAYMENT_878918",
            "type": "purchase",
            "status": "success",
            "date": "2024-02-16T11:08:25+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 100,
                "currency": "GBP"
            },
            "description": "TEST_PAYMENT_878918"
        },
        "operation": {
            "sum_initial": {
                "amount": 0,
                "currency": ""
            },
            "sum_converted": {
                "amount": 0,
                "currency": ""
            },
            "code": "0",
            "message": "Success",
            "provider": {
                "id": 16351,
                "payment_id": "MD000Z79BA94NF",
                "auth_code": ""
            },
            "id": 5049531010137015,
            "type": "recurring_cancel",
            "status": "success",
            "date": "2024-02-16T11:39:12+0000",
            "created_date": "2024-02-16T11:38:35+0000",
            "request_id": "6ef48716ca0809f0588e53d3-00094164"
        },
        "signature": "4M8mbH3W5oplKW1ipmZKApYVbTHrdGBNg=="
    }

Response format

The payment platform uses the standard format for response with debit series information. For more information about response format, see Response format.

Figure 21. Sample information about a debit series in a response
{
    "project_id": 1602,
    "recurring": {
        "id": 7305,
        "type": "R",
        "period": "W",
        "period_interval": 1,
        "start_date": "2024-02-06",
        "start_time": "00:49:23",
        "amount": 74000,
        "last_payment_at": "0000-00-00 00:00:00",
        "valid_thru": "2027-02-28 23:59:59",
        "status": "active",
        "description": "",
        "schedule_date": {
            "next": "2024-02-13 00:49:23"
        },
        "currency": "GBP"
    }
}

Useful links

The following articles can be useful when implementing purchases via Gate:

Refunds by using Gate

General information

To perform a refund through Gate by using the Direct Debit BACS method, send a request with all required parameters and signature to the ecommpay URL and receive a callback with the result. The full sequence and special aspects of refund performing are provided below.

Figure 22. Refund performing by using Gate: step-by-step description
  1. A customer initiates a refund.
  2. The web service sends the request for performing the refund by using Gate to the specified ecommpay URL.
  3. The payment platform receives the request.
  4. The payment platform validates the required parameters and signature in the request.
  5. The payment platform sends the response to the web service with information about the receipt of the request and its validity (details).
  6. The payment platform performs further processing of the request (with parameter consistency check) and sends it to the Direct Debit BACS service.
  7. The refund is processed on the side of the Direct Debit BACS service.
  8. The Direct Debit BACS service sends the result notification to the payment platform.
  9. The payment platform sends the result callback to the web service.
  10. The customer receives the refund result information from the web service.

Information about the formats of requests and callbacks used for performing refunds by using the Direct Debit BACS method via Gate is presented further in this section. General information about working with the Gate API is presented in Interaction concepts.

Note: By default refunds can be performed only after seven calendar days since the purchase has been processed; to enable the possibility of performing refunds before this time, contact your ecommpay account manager.

Request format

There are several things you need to consider when sending refund requests by using the Direct Debit BACS method:

  1. To initiate each refund, send a separate POST request to the /v2/payment/refund endpoint.
  2. Each request must include the following objects and parameters:
    • Object general—general refund information:
      • project_id—project identifier obtained from ecommpay during integration
      • payment_ididentifier of the payment that needs to be refundedpayment identifier
      • signature—request signature generated after all required parameters are specified (details—in the Signature generation and verification)
    • Object payment—refund information:
      • description—refund description or comment
      • amount—refund amount in the smallest currency unit (required for a partial refund)
      • currency—refund currency code in the ISO-4217 alpha-3 format (required for a partial refund)
    • Object customer—customer information:
      • ip_address—customer IP address relevant for the initiated refund
  3. Additionally, any other parameters included in the specification can be used.

Thus, a correct refund request by using the Direct Debit BACS method must contain the project and payment identifiers, description of the refund, the customer IP address, signature, and, if necessary, currency code and refund amount.

{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "description": "test refund",
    "amount": 1000,
    "currency": "GBP"
  },
  "customer": {
    "ip_address": "192.0.2.0"
  }
}
Figure 23. Example of sufficient data in a refund request
{
  "general": {
    "project_id": 210,
    "payment_id": "test_payment",
    "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA=="
  },
  "payment": {
    "description": "test refund",
    "amount": 1000,
    "currency": "GBP"
  },
  "customer": {
    "ip_address": "192.0.2.0"
  }
}

Callback format

The Direct Debit BACS method uses the standard format for callbacks to deliver refund results. For more information, see Callbacks.

The following is the example of a callback with information about a 1.00 GBP refund made in the 59051 project.

Figure 24. Example of callback data indicating that the refund has been processed
 {
        "payment": {
            "method_id": 2931,
            "need_confirm_retry": false,
            "actual_amount": 100,
            "cascading_with_redirect": false,
            "is_new_attempts_available": false,
            "attempts_timeout": 0,
            "status": "refunded",
            "id": "TEST_PAYMENT_175421",
            "method": "Direct Debit BACS",
            "date": "2024-02-12T13:57:14+0000",
            "result_code": "0",
            "result_message": "Success",
            "split_with_redirect": false,
            "provider_id": 16341
        },
        "sum_request": {
            "amount": 0,
            "currency": "GBP"
        },
        "rrn": "",
        "customer": {
            "id": "zxc"
        },
        "request_id": "daf48fcefbe98ca53fc82969c409-00081884",
        "transaction": {
            "id": 81883010089421,
            "date": "2024-02-12T13:57:14+0000",
            "type": "purchase"
        },
        "sum_real": {
            "amount": 100,
            "currency": "GBP"
        },
        "sum_refund": {
            "amount": 100,
            "currency": "GBP"
        },
        "recurring": {
            "id": 1720779781
        },
        "general": {
            "project_id": 59051,
            "payment_id": "TEST_PAYMENT_175421"
        },
        "description": "TEST_PAYMENT_175421",
        "cashout_data": {
            "customer_first_name": "Paul",
            "customer_id": "zxc",
            "customer_last_name": "Allen"
        },
        "signature": "xEumPOToRyH9/PFnyICB7eY/oxVatslhQWw=="
    }

The following is the example of a callback with information about a declined refund of an initial debit of funds.

Figure 25. Example of callback data indicating that the refund of an initial debit of funds has been declined
 {
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "TEST_PAYMENT_816625",
            "type": "purchase",
            "status": "success",
            "date": "2024-02-26T11:40:18+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 100,
                "currency": "GBP"
            },
            "description": "TEST_PAYMENT_816625"
        },
        "recurring": {
            "valid_thru": "2034-02-28T23:59:59+0000",
            "id": 1722138911,
            "currency": "GBP"
        },
        "operation": {
            "sum_initial": {
                "amount": 100,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 100,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "RF00006W2JHZWT",
                "auth_code": ""
            },
            "id": 83482010120825,
            "type": "refund",
            "status": "decline",
            "date": "2024-02-26T11:40:18+0000",
            "created_date": "2024-02-26T11:39:36+0000",
            "request_id": "b63907d503e7dc24bbe83981a1-00083483"
        },
        "signature": "Si+nDkjd+n/P1rGVwa3DZl5+sQ=="
    }

The following is the example of a callback with information about a declined refund of a separate debit of funds.

Figure 26. Example of callback data indicating that the refund of a separate debit of funds has been declined
 {
        "customer": {
            "id": "customer1"
        },
        "project_id": 59051,
        "payment": {
            "id": "qweqwe_1231231231001",
            "type": "recurring",
            "status": "success",
            "date": "2024-02-26T11:42:36+0000",
            "method": "Direct Debit BACS",
            "sum": {
                "amount": 400,
                "currency": "GBP"
            },
            "description": ""
        },
        "recurring": {
            "valid_thru": "2034-02-28T23:59:59+0000",
            "id": 1722138911,
            "currency": "GBP"
        },
        "operation": {
            "sum_initial": {
                "amount": 400,
                "currency": "GBP"
            },
            "sum_converted": {
                "amount": 400,
                "currency": "GBP"
            },
            "code": "20000",
            "message": "General decline",
            "provider": {
                "id": 16351,
                "payment_id": "",
                "auth_code": ""
            },
            "id": 65138010114741,
            "type": "refund",
            "status": "decline",
            "date": "2024-02-26T11:42:36+0000",
            "created_date": "2024-02-26T11:42:35+0000",
            "request_id": "adc663dacdec30ef1abbc60653e10-00065139"
        },
        "signature": "OTvoVoPScN5N4tvEVhteWi/TQZB6qxew=="
    }

Useful links

The following articles can be useful when implementing refunds via Gate:

Analysis of payments results

To analyse information about payments made with the Direct Debit BACS method and other methods, you can use:

  • Dashboard interface toolkit with various lists and analytic panels.
  • Reports in CSV file format, available via the Reports section (one-time and periodically).
  • Data in JSON format, sent by program requests to a specified URL available by using the Data API interface.

If you have any questions, refer to the documentation (Dashboard and Using Data API) and ecommpay technical support.