3.19. /api/v4/create-recurring-payments
Introduction
If request is accepted with no errors, the Payment Gateway creates separate recurring payment profiles for each entry provided in the request and assigns new recurring-payment-id to each of them. The recurring transactions will be processed according to the created recurring payment profiles using the payment data saved in each profile.
Create recurring payments Multiple is initiated through HTTPS POST request by using URLs and the parameters specified below. Use OAuth RSA-SHA256 for authentication.
API URLs
| Integration | Production |
|---|---|
| https://sandbox.billblend.com/checkout/api/v4/create-recurring-payments/ENDPOINTID | https://pay.billblend.com/checkout/api/v4/create-recurring-payments/ENDPOINTID |
Request Parameters
Note
Request must have content-type=application/x-www-form-urlencoded and Authorization headers.
Below is a description of each parameter that can be included in the CSV and added to payload parameter which will be used in the request.
The recurring payment profile details can be viewed only via UI.
| CSV Parameter Name | Description | Value |
|---|---|---|
| rp_card_type | SRC – Sender’s source card. DST – Receiver’s destination card. | Necessity: RequiredType: EnumLength: 3 |
| client-orderid | Connecting Party order ID. Supported for SRC and DST type. | Necessity: RequiredType: StringLength: 128 |
| credit-card-number | Payer`s credit card number. Supported for SRC and DST type. | Necessity: RequiredType: NumericLength: 19 |
| cvv2 | Payer’s CVV2 code. CVV2 (Card Verification Value) is a three- or four-digit number printed on the back of the card in the signature area. | Necessity: OptionalType: NumericLength: 3-4 |
| card-printed-name | Payer`s card printed name. Required for SRC, optional for DST. | Necessity: ConditionalType: StringLength: 128 |
| expire-year | Payer`s card expire year. Required for SRC, optional for DST. | Necessity: ConditionalType: NumericLength: 4 |
| expire-month | Payer`s card expire month. Required for SRC, optional for DST. | Necessity: ConditionalType: NumericLength: 2 |
| amount | Amount of currency must be the same as currency on the project assigned. Upon reaching finish date, Recurring payment will go into stop status. Supported for SRC and DST type. Required if amount-from and amount-to or amount-sequence are not used. | Necessity: ConditionalType: NumericLength: 10 |
| currency | Currency type. Supported for SRC and DST type. | Necessity: RequiredType: StringLength: 3 |
| country | Payer`s country. Not supported for DST. | Necessity: RequiredType: StringLength: 2 |
| city | Payer`s city. Not supported for DST. | Necessity: RequiredType: StringLength: 128 |
| zip-code | Payer`s zip-code. Not supported for DST. | Necessity: RequiredType: StringLength: 10 |
| address1 | Payer`s address. Not supported for DST. | Necessity: RequiredType: StringLength: 256 |
| first-name | Payer`s first-name. Not supported for DST. | Necessity: RequiredType: StringLength: 128 |
| last-name | Payer`s last-name. Not supported for DST. | Necessity: RequiredType: StringLength: 128 |
| Payer`s email. Not supported for DST. | Necessity: RequiredType: StringLength: 128 | |
| amount-from | If the combination of amount-from and amount-to is chosen, every charge will be of random amount between these two numbers. Supported for SRC and DST type. Required if amount or amount-sequence are not used. | Necessity: ConditionalType: NumericLength: 10 |
| amount-to | If the combination of amount-from and amount-to is chosen, every charge will be of random amount between these two numbers. Supported for SRC and DST type. Required if amount or amount-sequence are not used. | Necessity: ConditionalType: NumericLength: 10 |
| amount-sequence | If amount sequence is chosen, client will be charged amounts from this list. Example of setting up amount sequence: 10.5, 24.6, 32.0. If repeats number is higher than amount sequence number of elements, every new charge will be with last amount in amount sequence. In order for charges to begin from the first amount in the chain, current repeats number must be set as 0. Supported for SRC and DST type. Required if amount-from and amount-to or amount are not used. | Necessity: ConditionalType: NumericLength: 10 |
| period | Possible values are: day, week and month. In case if daily is chosen, client will be charged every day. If week – every 7 days. If monthly is chosen, client will be charged on the same date of the month, from the starting date, no matter how many days there are in a month. Interval and period can only be specified or omitted together. Not supported for DST. | Necessity: ConditionalType: StringLength: 32 |
| interval | Interval is a multiplier applied to the period. For example, if interval of 2 and period ‘Daily’ is selected, client will be charged once every 2 days. Interval and period can only be specified or omitted together. Not supported for DST. | Necessity: ConditionalType: IntLength: – |
| order_desc | Description of Recurring payment. Supported for SRC and DST type. | Necessity: OptionalType: StringLength: 65K |
| customer-ip | Payer`s IP address. Supported for SRC and DST type. | Necessity: OptionalType: StringLength: 45 |
| ssn | Social security number field. Not supported for DST. | Necessity: OptionalType: StringLength: 32 |
| birthday | Payer`s birthday date. Not supported for DST. | Necessity: OptionalType: 8/Numeric, DD.MM.YYYYLength: 8 |
| phone | Payer`s phone number. Not supported for DST. | Necessity: OptionalType: StringLength: 128 |
| state | Payer’s state. Please see Mandatory State codes for a list of valid state codes. Required for USA, Canada and Australia.Not supported for DST. | Necessity: OptionalType: StringLength: 2-3 |
| start-date | Date, when first charge is scheduled. If start date is set as a current date and type is set as auto, first charge will be made today. Supported for SRC and DST type. | Necessity: OptionalType: 8/Numeric, DD.MM.YYYYLength: 8 |
| finish-date | Date, when the Payer will be charged last time. Supported for SRC and DST type. | Necessity: OptionalType: 8/Numeric, DD.MM.YYYYLength: 8 |
| max-repeats-number | Index of recurring transaction, first charge will hold the index of 0. Current repeats number increases even if a charge was unsuccessful. When current repeats number reaches max repeats number, Recurring payment goes into stop status and client is charged no more. If a charge was made automatically, no additional charges will be made(unless done manually), even if a recurring payment is stopped and rescheduled again. Supported for SRC and DST type. | Necessity: OptionalType: IntLength: – |
| purpose | Purpose of transaction. Not supported for DST. | Necessity: OptionalType: StringLength: 128 |
| notify_url | Notify url field. server_callback_url parameter can also be used. For more information please see Connecting Party Callbacks. Supported for SRC and DST type. | Necessity: OptionalType: StringLength: 1024 |
| server_callback_url | Connecting Party URL which will receive callback request once the transaction reaches final status. Connecting Party may use Server Callback URL for custom processing of the transaction completion, e.g. to collect payment data in the Connecting Party’s information system. See callback details in Connecting Party callback parameters. Send either notify_url or server_callback_url, not both. | Necessity: OptionalType: StringLength: 128 |
Note
If the recurrent has switched to Stopped, you can update its schedule using the start-date and finish-date parameters. However, it can only be resumed via the UI by clicking on Resume.
Type native on UI means that The recurring payment setup and the actual charges are in the same acquirer.
To create recurring payment profile with automatic recurring schedule, send interval and period parameters. To create recurring payment profile without automatic recurring schedule, do not send interval and period parameters. To stop the automatic recurring schedule, use /api/v4/update-recurring-payments. Available only for SRC.
Response Parameters
Note
Response has Content-Type: text/html;charset=utf-8 header. All fields are x-www-form-urlencoded, with (0xA) character at the end of each parameter’s value.
| Response Parameters | Description |
|---|---|
| type | The type of response. May be create-recurring-payment-response, validation-error, error. If type equals validation-error or error, error-message and error-code parameters contain error details. Multiple error codes may be received: 200, 403, and 500. For the 500 error code, an additional error ID will be returned. |
| recurring-payment-id | Recurring ID assigned to the order by Billblend. |
| status | See Status List for details. |
| serial-number | Unique number assigned by Billblend server to particular request from the Connecting Party. |
Request Example
Step 1. Create a CSV with the provided structure:
"client-orderid";"rp_card_type";"payment-description";"first-name";"last-name";"address1";"city";"zip-code"; "country";"state";"phone";"email";"customer-ip";"period";"interval";"start-date";"finish-date";"max-repeats-number";"amount"; "amount-from";"amount-to";"amount-sequence";"currency";"card-printed-name";"credit-card-number";"expire-month";"expire-year"
Step 2. Encode CSV to base64 with the following command:
base64 create-recurring-payments-example.csv
Step 3. Assign the base64 encoded value to payload parameter and send the request:
POST /checkout/api/v4/create-recurring-payments/ HTTP/1.1 Host: sandbox.billblend.com User-Agent: curl/8.4.0 Accept: */* Content-Type: application/x-www-form-urlencoded Authorization: OAuth oauth_consumer_key="ErwinTestMerchant",oauth_signature_method="RSA-SHA256",oauth_timestamp="1727178538",oauth_nonce="cdtNANOCATq",oauth_version="1.0",oauth_signature="B5m%2FOQOSBgqWI%2F%2FG3GhZw2kCJZDda7J6fLpOu6wFyBEj60PJp5u1mqBnIufzkkmrSkyZkCT6v12WIhwE%2BWTtJ7Wg%2BRx9cqXPfhk5JhQpnofsVheXpCpftoLvvBTqn8p67WaS%2B6kfzGtGhdXHYVBzIxXDxabnMjMC8u8EtfWsovzTp%2BAYfZKn2H0qH7B62dfUW4PuRCTmy9svbwLhbPULkh3oJ3a1M%2BnRqXIasIrd3WY1MD9lkqUetAtW3xIWnOoMvPZ0wzk2UEbU%2BoZ2KTiA9KO09%2Ffq7OylRhiDpqtz65EMBiKujFFSF42bzYsB1SmPssk09xJoWmsNR9tFZsdx2Hgl7yFZTXhxV3nlSZTGDVZaVe2pPSi8va5W9yTlPMPU5HcNE5MuZ3T9PSEURQvM691UcPSdlJAi8q7B0EhXDzwOlgLV7DsFDtpsXSeXopFpG6uHiNPIjW65p6XFQ31xr4foZCahVeymuIoiXE6uAkHJJ89oHqKsOBnI7xILu2UpflHnl7gn%2BvX9IWdUHx1xEMdBPWdUQRFNllGvT2N8nYrtZe96L%2BfwxarYR2Fh1LtyqwCtEXhQm5jhjpR3NQpqddY3NSd75NUP7zlDQwXCknMQps6uSdng9Uv%2B7IFx3oNUfjVMxp4CGcmEtSxH7Ykx8dX5srNOKLDJT5tyExLLjXk%3D" Content-Length: 754 Connection: keep-alive payload=Y2xpZW50LW9yZGVyaWQ7cnBfY2FyZF90eXBlO29yZGVyX2Rlc2M7Zmlyc3QtbmFtZTtsYXN0LW5hbWU7YWRkcmVzczE7Y2l0eTt6aXAtY29kZTtjb3VudHJ5O3N0YXRlO3Bob25lO2VtYWlsO3BlcmlvZDtpbnRlcnZhbDtzdGFydC1kYXRlO2ZpbmlzaC1kYXRlO21heC1yZXBlYXRzLW51bWJlcjthbW91bnQ7YW1vdW50LWZyb207YW1vdW50LXRvO2Ftb3VudC1zZXF1ZW5jZTtjdXJyZW5jeTtjYXJkLXByaW50ZWQtbmFtZTtjcmVkaXQtY2FyZC1udW1iZXI7ZXhwaXJlLW1vbnRoO2V4cGlyZS15ZWFyO2N2djI7cHVycG9zZTtub3RpZnktdXJsO3NzbjtiaXJ0aGRheQ0KMTIzNDU2Nzg5MDtTUkM7O1dpbGw7U3RpbGw7MTIzNCBSZWluO1JlaW1zOzEyMzQ1NjtGUjtCUkU7MTIzNDU2Nzg7d2lsbHN0aWxsQGV4YW1wbGUuY29tO3dlZWs7MTsxNi4wOS4yMDI0OzE3LjA5LjIwMjQ7MTAwMDsxMDs7OztVU0Q7V0lMTCBTVElMTDs0NDU4MjA0NjgxMzg3MDUzOzEyOzIwNDA7MTIzO05vIHB1cnBvc2UgYXQgYWxsO2h0dHA6Ly9leGFtcGxlLmNvbS9jcmVhdGUtbWU7MTIzNDsyMi4wMS4xOTgwDQo%3D
Success Response Example
Note
The successful response has empty body and HTTP code 200.
HTTP/1.1 200 Server: server Date: Tue, 24 Sep 2024 09:44:01 GMT Content-Length: 0 Connection: keep-alive Keep-Alive: timeout=60 X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 Strict-Transport-Security: max-age=31536000
Fail Response Example
Note
The unsuccessful response has empty body and HTTP code 403.
HTTP/1.1 403 Server: server Date: Wed, 25 Sep 2024 08:45:42 GMT Content-Length: 0 Connection: keep-alive Keep-Alive: timeout=60 X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000