# Direct Debit SEPA {#pm_dd_sepa} **Parent topic:**[Bank payments](en_pm_bankpayments.md) ## Overview {#en_pm_dd_sepa_overview} An article about the payment method which allows you to process payments in euros by using bank accounts in the SEPA countries and supports COF purchases and refunds. ### Introduction {#section_t5z_rlg_ytb .section} Direct Debit SEPA is a payment method which allows you to process payments in euros by using bank accounts in the SEPA countries. This method allows funds to be debited directly from the bank accounts of customers. This method supports COF purchases and refunds. This article provides information about working with the Direct Debit SEPA 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 {#section_tbf_2zk_ggb .section} |Payment method type|bank payments| |Payment instruments|bank accounts| |Countries and regions|[AD](references/en/countries/AD.md), [AT](references/en/countries/AT.md), [BE](references/en/countries/BE.md), [BG](references/en/countries/BG.md), [HR](references/en/countries/HR.md), [CY](references/en/countries/CY.md), [CZ](references/en/countries/CZ.md), [DK](references/en/countries/DK.md), [EE](references/en/countries/EE.md), [FI](references/en/countries/FI.md), [FR](references/en/countries/FR.md), [DE](references/en/countries/DE.md), [GR](references/en/countries/GR.md), [HU](references/en/countries/HU.md), [IS](references/en/countries/IS.md), [IE](references/en/countries/IE.md), [IT](references/en/countries/IT.md), [LV](references/en/countries/LV.md), [LI](references/en/countries/LI.md), [LT](references/en/countries/LT.md), [LU](references/en/countries/LU.md), [MT](references/en/countries/MT.md), [MC](references/en/countries/MC.md), [NL](references/en/countries/NL.md), [NO](references/en/countries/NO.md), [PL](references/en/countries/PL.md), [PT](references/en/countries/PT.md), [RO](references/en/countries/RO.md), [SM](references/en/countries/SM.md), [SK](references/en/countries/SK.md), [SI](references/en/countries/SI.md), [ES](references/en/countries/ES.md), [SE](references/en/countries/SE.md), [CH](references/en/countries/CH.md), [GB](references/en/countries/GB.md), [VA](references/en/countries/VA.md)| |Payment currencies|[EUR](references/en/currencies/EUR.md)| |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 {#section_tsp_gzk_ggb .section} Payment processing by using the Direct Debit SEPA method involves the merchant's web service, one of Ecommpay interfaces, the Ecommpay payment platform, and technical facilities of the provider service. ### Operations support {#section_rnx_4cl_ggb .section} Various platform interfaces can be used to process payments and perform operations using the Direct Debit SEPA 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 2 business days. This time can be extended due to holidays and weekends. A payment is automatically assigned the `decline` status if it wasn't processed within the threshold time. ### Processing scenarios {#section_fgt_sdl_ggb .section} To perform a purchase by using the Direct Debit SEPA method, you need to redirect the customer to the Direct Debit SEPA 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 {#en_pm_dd_sepa_pp_purchase} ### General information {#section_gtg_vxk_m2b .section} When using Payment Page and the Direct Debit SEPA 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](en_platform_sheduled_recurring_model.md)\). 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](en_platform_recurring_model.md)\). In this case, to debit funds, each time a separate Gate request is required \([details](pm_dd_sepa.md#)\). 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 Pageby using the Direct Debit SEPA 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 SEPA method via Payment Page is presented further in this section; general information about working with the Payment Page API is presented in [Interaction concepts](en_pp_interaction_organisation.md#). ### Request format for registration without the initial debit of funds {#section_p5j_fgl_ggb .section} 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 SEPA 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. 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-sepa` method code in the `force_payment_method` parameter and the `card_verify` value in the `mode` parameter. 3. To register a COF purchase, you must specify a `recurring` object containing the registration attribute and the necessary information. The Direct Debit SEPA 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](en_pp_recurring.md) section. 4. Additionally, any other parameters available for working with Payment Page can be used \([details](en_PP_Parameters.md)\). 5. After all target parameters are specified, generate a signature \([details](en_platform_signature.md#)\). Thus, a correct request for opening the payment form using the Direct Debit SEPA method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer and COF purchase information, as well as signature. ``` {#codeblock_qy4_bhy_m2c .language-json} { "project_id": 120, "payment_id": "580", "payment_currency": "EUR", "payment_amount": 0, "customer_id": "customer1", "customer_first_name": "John", "customer_last_name": "Doe", "force_payment_method": "directdebit-sepa", "mode": "card_verify", "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==" } ``` ``` {#codeblock_yzq_bhy_m2c .language-json} { "project_id": 120, "payment_id": "580", "payment_currency": "EUR", "payment_amount": 0, "customer_id": "customer1", "customer_first_name": "John", "customer_last_name": "Doe", "force_payment_method": "directdebit-sepa", "mode": "card_verify", "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 {#section_qt3_qfl_j1c .section} 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 SEPA 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. Additionally, it is necessary to specify the first and last names of the customer in the parameters `customer_first_name` and `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 SEPA 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](en_pp_recurring.md) section. 4. If you need to have the payment form displayed with the Direct Debit SEPA method selected, set the `force_payment_method` parameter to `directdebit-sepa`. 5. Additionally, any other parameters available for working with Payment Page can be used \([details](en_PP_Parameters.md)\). 6. After all target parameters are specified, generate a signature \([details](en_platform_signature.md#)\). Thus, a correct request for opening the payment form using the Direct Debit SEPA method must contain the project identifier, basic payment information \(identifier, amount, and currency code\), customer and COF purchase information, as well as signature. ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "EUR", "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==" } ``` ```language-json { "project_id": 120, "payment_id": "580", "payment_amount": 1000, "payment_currency": "EUR", "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 {#section_dpx_2hl_ggb .section} The Direct Debit SEPA method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md#). 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. ```language-json { "project_id": 430716, "payment": { "id": "ORDER_ID_342011450", "type": "directdebit", "status": "success", "date": "2024-01-19T07:55:49+0000", "method": "Direct Debit SEPA", "sum": { "amount": 1, "currency": "EUR" }, "description": "" }, "customer": { "id": "customer1" }, "recurring": { "id": 9738, "currency": "EUR", "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": "EUR" }, "sum_converted": { "amount": 1, "currency": "EUR" }, "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. ```language-json { "project_id": 430716, "payment": { "id": "ORDER_ID_702917140", "type": "purchase", "status": "success", "date": "2024-01-18T12:39:38+0000", "method": "Direct Debit SEPA", "sum": { "amount": 10000, "currency": "EUR" }, "description": "" }, "customer": { "id": "customer1" }, "recurring": { "id": 8224, "currency": "EUR", "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": "EUR" }, "sum_converted": { "amount": 10000, "currency": "EUR" }, "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. ``` { "customer": { "id": "customer1" }, "project_id": 59051, "payment": { "id": "test_sepa", "type": "directdebit", "status": "decline", "date": "2024-02-26T11:10:04+0000", "method": "Direct Debit SEPA", "sum": { "amount": 0, "currency": "EUR" }, "description": "" }, "operation": { "sum_initial": { "amount": 0, "currency": "EUR" }, "sum_converted": { "amount": 0, "currency": "EUR" }, "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. ``` { "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 SEPA", "sum": { "amount": 100, "currency": "EUR" }, "description": "TEST_PAYMENT_246302" }, "operation": { "sum_initial": { "amount": 100, "currency": "EUR" }, "sum_converted": { "amount": 100, "currency": "EUR" }, "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 {#section_xpz_thl_ggb .section} The following articles can be useful when implementing purchases via Payment Page: - [Interaction concepts](en_pp_interaction_organisation.md#)—about the interaction with the payment platform by using Payment Page. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## COF purchases by using Gate {#en_pm_dd_sepa_gate_purchase} ### General information {#section_lsx_3jl_ggb .section} When using Gate and the Direct Debit SEPA 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](en_platform_sheduled_recurring_model.md)\). 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](en_platform_recurring_model.md)\). 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 SEPA 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 SEPA 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 SEPA method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). ### Request format for registration without the initial debit of funds {#section_osx_3jl_ggb .section} 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 SEPA method: 1. To register each purchase, send a separate POST request to the `/v2/payment/directdebit/sepa/contract/registration` endpoint. This endpoint belongs to the group [/v2/payment/directdebit/\{payment\_method\}/contract/registration](https://api-developers.ecommpay.com/api-specification/direct-debit/post-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 identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `currency`—payment currency codein the ISO-4217 alpha-3 format - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant 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 SEPA 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](en_gate_payment_recurring_registration.md) section. 4. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase registration request by using the Direct Debit SEPA method must contain the project identifier, basic payment information \(identifier and currency code\), customer and COF purchase information, as well as signature. ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "currency": "EUR" }, "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" } } ``` ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "currency": "EUR" }, "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 {#section_rkj_vlm_j1c .section} 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 SEPA method: 1. To register each purchase, send a separate POST request to the `/v2/payment/directdebit/sepa/sale` endpoint. This endpoint belongs to the group [/v2/payment/directdebit/\{payment\_method\}/sale](https://api-developers.ecommpay.com/api-specification/direct-debit/post-v2-payment-directdebit-payment-method-sale). 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—payment information: - `amount`—payment amount in the smallest currency unit - `currency`—payment currency codein the ISO-4217 alpha-3 format - Object `customer`—customer information: - `id`—customer identifierunique within the project - `ip_address`—customer IP addressrelevant 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 SEPA 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](en_gate_payment_recurring_registration.md) section. 4. Additionally, any other parameters included in the specification can be used. Thus, a correct purchase registration request by using the Direct Debit SEPA method must contain the project identifier, basic payment information \(identifier, amount and currency code\), customer and COF purchase information, as well as signature. ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "amount": 1000, "currency": "EUR" }, "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" } } ``` ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "amount": 1000, "currency": "EUR" }, "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 {#section_sxr_kmm_j1c .section} There are several things you must consider when sending requests for separate debits of funds by using the Direct Debit SEPA method: 1. To perform each debit, send a separate POST request to the `/v2/payment/directdebit/sepa/recurring` endpoint. This endpoint belongs to the group [/v2/payment/directdebit/\{payment\_method\}/recurring](https://api-developers.ecommpay.com/api-specification/direct-debit/post-v2-payment-directdebit-payment-method-recurring). 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - 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 SEPA method must contain the project and COF purchase identifiers, customer and payment information, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6wx/OqrWdbltzO5GMSkzd0Iq6lM2...==", }, "customer": { "ip_address": "192.0.2.0" }, "payment": { "amount": 1000, "currency": "EUR" }, "recurring": { "id": 1234567890 } } ``` ### Request format for getting information about a debiting series {#section_slv_pmm_j1c .section} There are several things you must consider when sending a request for information about a debiting series by using the Direct Debit SEPA method: 1. To request information each time send a separate POST request to the [/v2/payment/recurring/info](https://api-developers.ecommpay.com/api-specification/direct-debit/post-v2-payment-recurring-info) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general purchase information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - 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 SEPA method must contain the project, payment and COF purchase identifiers, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==", }, "recurring": { "id": 1234567890 } } ``` ### Request format for updating a debiting series {#section_zhr_wmm_j1c .section} There are several things you must consider when updating a debiting series by using the Direct Debit SEPA method: 1. For each update send a separate POST request to the `/v2/payment/directdebit/sepa/recurring/update` endpoint. This endpoint belongs to the group [/v2/payment/directdebit/\{payment\_method\}/recurring/update](https://api-developers.ecommpay.com/api-specification/direct-debit/post-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 identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - 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 SEPA method must contain project ID, payment ID, signature, ID of debit series, and debit series parameters to update. ```language-javascript { "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 {#section_zcz_ymm_j1c .section} There are several things you must consider when cancelling COF purchases by using the Direct Debit SEPA method: 1. To cancel each purchase, send a separate POST request to the `/v2/payment/directdebit/sepa/recurring/cancel` endpoint. This endpoint belongs to the group [/v2/payment/directdebit/\{payment\_method\}/recurring/cancel](https://api-developers.ecommpay.com/api-specification/direct-debit/post-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 identifierobtained from Ecommpay during integration - `payment_id`—payment identifierunique within the project - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - 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 SEPA method must contain the project, payment and COF purchase identifiers, as well as signature. ```language-javascript { "general": { "project_id": 208, "payment_id": "TEST_15427007172789", "signature": "DH0v2pZnkK9hwytQ6/ZtDzO5GMSkzd0Iq6lM2v8...==", }, "recurring": { "id": 1234567890 } } ``` ### Formats of intermediate callbacks for customer redirection {#section_nxg_hmn_zgb .section} Each payment made with the Direct Debit SEPA method requires redirection of customers from the merchant's web service to the Direct Debit SEPA 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](en_platform_callbacks.md#)\), 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 ```language-json "redirect_data": { "body": {}, "method": "GET", "url": "https://www.example.com/pay" } ``` ### Callback format {#section_dpx_2hl_ggb .section} The Direct Debit SEPA method uses the standard format for callbacks to deliver purchase results. For more information, see [Handling callbacks](en_platform_callbacks.md#). 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. ```language-json { "project_id": 430716, "payment": { "id": "ORDER_ID_342011450", "type": "directdebit", "status": "success", "date": "2024-01-19T07:55:49+0000", "method": "Direct Debit SEPA", "sum": { "amount": 1, "currency": "EUR" }, "description": "" }, "customer": { "id": "customer1" }, "recurring": { "id": 9738, "currency": "EUR", "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": "EUR" }, "sum_converted": { "amount": 1, "currency": "EUR" }, "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. ```language-json { "project_id": 430716, "payment": { "id": "ORDER_ID_702917140", "type": "purchase", "status": "success", "date": "2024-01-18T12:39:38+0000", "method": "Direct Debit SEPA", "sum": { "amount": 10000, "currency": "EUR" }, "description": "" }, "customer": { "id": "customer1" }, "recurring": { "id": 8224, "currency": "EUR", "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": "EUR" }, "sum_converted": { "amount": 10000, "currency": "EUR" }, "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. ``` { "customer": { "id": "customer1" }, "project_id": 59051, "payment": { "id": "test_sepa", "type": "directdebit", "status": "decline", "date": "2024-02-26T11:10:04+0000", "method": "Direct Debit SEPA", "sum": { "amount": 0, "currency": "EUR" }, "description": "" }, "operation": { "sum_initial": { "amount": 0, "currency": "EUR" }, "sum_converted": { "amount": 0, "currency": "EUR" }, "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. ```language-json { "project_id": 430716, "payment": { "id": "ORDER_ID_494065730", "type": "recurring", "status": "success", "date": "2024-01-24T16:02:17+0000", "method": "Direct Debit SEPA", "sum": { "amount": 10000, "currency": "EUR" }, "description": "" }, "customer": { "id": "customer1" }, "recurring": { "id": 5768, "currency": "EUR", "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": "EUR" }, "sum_converted": { "amount": 10000, "currency": "EUR" }, "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. ```language-json { "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 SEPA", "sum": { "amount": 400, "currency": "EUR" }, "description": "" }, "recurring": { "valid_thru": "2030-01-31T23:59:59+0000", "id": 1721154593, "currency": "EUR" }, "operation": { "sum_initial": { "amount": 400, "currency": "EUR" }, "sum_converted": { "amount": 400, "currency": "EUR" }, "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. ```language-json { "project_id":123, "recurring":{ "id":1079, "currency":"EUR", "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. ```language-json { "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 SEPA", "sum": { "amount": 100, "currency": "EUR" }, "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 {#section_mxj_bnm_j1c .section} The payment platform uses the standard format for response with debit series information. For more information about response format, see [Response format](en_gate_interaction_organisation.md#). ```language-json { "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": "EUR" } } ``` ### Useful links {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing purchases via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Refunds by using Gate {#en_pm_dd_sepa_gate_refund} ### General information {#section_lsx_3jl_ggb .section} To perform a refund through Gate by using the Direct Debit SEPA method, send a request with all required parameters and signature to the Ecommpay URL and receive a callback with the result. 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](en_gate_interaction_organisation.md#)\). 6. The payment platform performs further processing of the request \(with parameter consistency check\) and sends it to the Direct Debit SEPA service. 7. The refund is processed on the side of the Direct Debit SEPA service. 8. The Direct Debit SEPA 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 SEPA method via Gate is presented further in this section. General information about working with the Gate API is presented in [Interaction concepts](en_gate_interaction_organisation.md#). **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 {#section_osx_3jl_ggb .section} There are several things you need to consider when sending refund requests by using the Direct Debit SEPA method: 1. To initiate each refund, send a separate POST request to the [/v2/payment/refund](https://api-developers.ecommpay.com/api-specification/direct-debit/post-v2-payment-refund) endpoint. 2. Each request must include the following objects and parameters: - Object `general`—general refund information: - `project_id`—project identifierobtained from Ecommpay during integration - `payment_id`—identifier of the payment that needs to be refunded - `signature`—request signaturegenerated after all required parameters are specified \(details—in the [Signature generation and verification](en_platform_signature.md#)\) - Object `payment`—refund information: - `description`—refund description or comment - Object `customer`—customer information: - `ip_address`—customer IP addressrelevant 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 SEPA method must contain the project and payment identifiers, description of the refund, the customer IP address and signature. ```language-json { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "description": "test refund" }, "customer": { "ip_address": "192.0.2.0" } } ``` ``` {#codeblock_qqj_kyn_42c .language-json} { "general": { "project_id": 210, "payment_id": "test_payment", "signature": "PJkV8ej\/UG0Di8hTng6JvipTv+AWoXW\/9MTO8yJA==" }, "payment": { "description": "test refund" }, "customer": { "ip_address": "192.0.2.0" } } ``` ### Callback format {#section_dpx_2hl_ggb .section} The Direct Debit SEPA method uses the standard format for callbacks to deliver refund results. For more information, see [Handling callbacks](en_platform_callbacks.md#). The following is the example of a callback with information about a `1.00 EUR` refund made in the `59051` project. ```language-json { "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": "EUR" }, "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": "EUR" }, "sum_refund": { "amount": 100, "currency": "EUR" }, "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. ```language-json { "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 SEPA", "sum": { "amount": 100, "currency": "EUR" }, "description": "TEST_PAYMENT_816625" }, "recurring": { "valid_thru": "2034-02-28T23:59:59+0000", "id": 1722138911, "currency": "EUR" }, "operation": { "sum_initial": { "amount": 100, "currency": "EUR" }, "sum_converted": { "amount": 100, "currency": "EUR" }, "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. ```language-json { "customer": { "id": "customer1" }, "project_id": 59051, "payment": { "id": "qweqwe_1231231231001", "type": "recurring", "status": "success", "date": "2024-02-26T11:42:36+0000", "method": "Direct Debit SEPA", "sum": { "amount": 400, "currency": "EUR" }, "description": "" }, "recurring": { "valid_thru": "2034-02-28T23:59:59+0000", "id": 1722138911, "currency": "EUR" }, "operation": { "sum_initial": { "amount": 400, "currency": "EUR" }, "sum_converted": { "amount": 400, "currency": "EUR" }, "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 {#section_xsx_3jl_ggb .section} The following articles can be useful when implementing refunds via Gate: - [Interaction concepts](en_gate_interaction_organisation.md#)—about the interaction with the payment platform by using Gate. - [Signature generation and verification](en_platform_signature.md#)—about the procedure of generating and verifying signatures in requests and callbacks. - [Payment processing](en_platform_payment_model.md)—about the types, processing models, and possible statuses of supported payments and operations. - [Purchase refunds](en_Gate_Refund.md)—about performing of refunds by using Gate. - [Handling operation processing information](en_platform_payment_info_codes.md)—about error and response codes that are used in the payment platform to record information about performing of operations. ## Analysis of payments results {#en_pm_dd_sepa_dash_analysis} To analyse information about payments made with the Direct Debit SEPA method and other methods, you can use: - Dashboardinterface toolkitwith 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 by using the Data API interface. If you have any questions, refer to the documentation \([Dashboard](en_dbl_about.md) and [Using Data API](en_dbl_api_protocol.md)\) and Ecommpay technical support.