Anchor | ||||
---|---|---|---|---|
|
Direct Debits
POST /pay/v1/directdebits
Headers
Content-Typestring
Content type.
Authorizationstring
Access token generated from create token request.
Attributes
payment_intentstring
Payment intent token.
given_namestring
User’s given name or first name.
family_namestring
User’s family name or Surname.
company_namestring (optional)
User’s company name. It’s required only if user’s given name and family name are not present.
emailstring
User’s email address.
country_codestring
ISO country code. Default value GB.
customer_addressstring (optional)
User’s address details.
customer_postcodestring (optional)
User’s postcode.
account_holder_namestring
User’s bank account name.
branch_codestring
User’s bank short code.
account_numberinteger
User’s bank account number.
merchant_data json (optional)
The merchant can add custom key value pairs in JSON format, for example:
Code Block |
---|
{
"my_order_id": 123,
"fancy_note": "Order complete",
"card_discount": false
} |
Request
Code Block |
---|
POST https://secure.blinkpayment.co.uk/api/pay/v1/directdebits HTTP/1.1 Content-Type: application/json Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbG... { "payment_intent": "pi_Swhc84aSLtUGppvPARX...", "given_name": "test", "family_name": "test", "email": "random@gmail...", "country_code": "GB" "customer_address": "12/B.....", "customer_postcode": "12....", "account_holder_name": "test.....", "branch_code": 20...., "account_number": "579....", "merchant_data": "{\"my_order_id\": \"dd-12345678\"}", } |
Response
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json { "url": "https://api-demo-phpapp.blinkpayment.co.uk/return?res=QkwtTVlVRTV...%3D%3D" }transaction_id=BL-002A12345&status=Pending%2BSubmission¬e=Pending%2BSubmission&merchant_data=%257B%2522order_id%2522%253A%2522dd-12345678%2522%257D" } |
Response codes
Code | Status | Title | Message | Notes |
200 | Pending submission | Pending submission | If payment is successful, then this status will be returned. | If payment is successful, then this status will be returned. The payment has been created, but not yet submitted to the banks |
200 | Submitted | Submitted | If payment is successful, then this status will be returned in later stage. | If payment is successful, then this status will be returned in later stage. The payment has been submitted to the banks. |
200 | Paid out | Paid out | If payment is successful, then this status will be returned in later stage. | If payment is successful, then this status will be returned in later stage. The payment has been included in a payout (i.e. ready to transfer to creditor’s account) |
400 | Failed | Validation error | Given name is required if company name is not present | If given name is not present in the absence of company name, Direct Debits request will return this status |
400 | Failed | Validation error | Family name is required if company name is not present | Family name and given name, both are required in the absence of company name in Direct Debits request |
400 | Failed | Validation error | Company name is required if given name and family name are not present | If company name is not present along with given name and first name, Direct Debits request will return this status |
400 | Failed | Validation error | Email address is required | If email is not present, Direct Debits request will return this status |
400 | Failed | Validation error | Account holder name is required | If account holder name is not present, Direct Debits request will return this status |
400 | Failed | Validation error | Branch code is required | If branch code is not present, Direct Debits request will return this status |
400 | Failed | Validation error | Account number is required | If account number is not present, Direct Debits request will return this status |
401 | Failed | Authorisation error | Direct debit is not enabled to this merchant account | If merchant’s Gocardless account is not connected with their blink account, then this status will be returned |