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, e.g. Authentication: Bearer {{access_token}}.

Access token is expired after 30 minutes. Then, you need to call refresh token request to regenerate the create a new 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.

Resources

POST /v1/pay/token
POST /v1/pay/token/refreshtokens


Anchor
create-token
create-token

Create token

POST /pay/v1/pay/tokentokens

Attributes

api_keystring
256 alpha numeric, obtained through the Blink platform.

secret_key string
256 alpha numeric, obtained through the Blink platform.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/pay/v1/pay/tokentokens HTTP/1.1
Content-Type: application/json

{ 
    "api_key": "49f98f211008be298aaa244...", 
    "secret_key": "44b51da04a1ff0caa73afd..." 
}

Response

Code Block
HTTP/1.1 200 OK
Content-Type: application/json

{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbG...",
    "expired_on": "2023-01-01T12:00:00Z",
    "payment_types": ["credit-card", "open-banking", "direct-debit"],
    "currency": "GBP",
    "send_blink_receipt": "Yes"
}
Anchorrefresh-tokenrefresh-tokenRefresh token

POST /v1/pay/token/refresh

Attributes

access_tokenstring
256 Alpha numeric, obtained through the create token request.

Request

Code Block
POST https://secure.blinkpayment.co.uk/api/v1/pay/token/refresh HTTP/1.1
Content-Type: application/json

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbG..."
}

Response

Code Block
HTTP/1.1 200 OK
Content-Type: application/json

{ 
    "access_token": "IjoiMTNkYjI0NGI1MWRh...", 
    "expired_on": "2023-01-01T12:00:00Z",
    "currency": "GBP",
    "send_blink_receipt": "Yes"
}