Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To authenticate requests, the Blink API uses an api_key and secret_key combination, which is used to obtain an access_token for your session.

HTTP Basic Auth is used for authentication. The access_token should be used via bearer in the header to authenticate all requests

Authenticate requests using HTTP Basic Auth by adding a bearer token to the header, e.g. Authentication: Bearer {{access_token}}. You can manage and renew your keys on the Blink platform. In case you do not see the keys, simply reach out to support to get set up.

It is essential to keep your API keys secure as they hold significant privileges. Refrain from sharing your secret API keys in public areas such as GitHub, client-side code, etc.

All API requests must be made over HTTPS. Requests made over plain HTTP will be unsuccessful. API requests that lack authentication will also fail.get the {{access_token}} from the create token request.



Create intent

Merchant specified url to fetch payment status later 

POST /v1/pay/intent

Attributes

amountfloat
Actual amount value.

payment_type string
credit-card, direct-debit, open-banking 

currency string
Currency value (ex. USD,GBP) 

reutrn_url string
Merchant specified url to get the response back 

notification_url string
Merchant specified url to fetch payment status later 

user_metadata json (optional)
Customer details can be present here with the following keys. “customer_name“customer_email”,”customer_address”,”customer_postcode”

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/v1/pay/intent
Content-Type: application/json
Authentication: Bearer eyJ0eXAiOiJKV1QiLCJhbG...

{
    "amount": 1.01,
    "payment_type": "credit-card",
    "currency": "GBP",
    "return_url": "https://mydomain.com/return",
    "notification_url": "https://mydomain.com/notification"
}

Response

Code Block
{
    "id": 123,
    "payment_intent": "pi_Swhc84aSLtUGppvPARX...",
    "expired_on": "2023-01-01T12:00:00Z",
    "amount": 1.01,
    "currency": "GBP",
    "payment_type": "credit-card",
    "return_url": "https://mydomain.com/return",
    "notification_url": "https://mydomain.com/notification"
}