Accept BLIK payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.
Before you begin
These instructions explain how to add BLIK to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.
Before starting your BLIK integration:
- Make sure that you have set up your back end implementation.
- Add BLIK in your Customer Area.
Build your payment form for BLIK
To show BLIK in your payment form, you need to:
-
Show BLIK as an available payment method.
We provide a BLIK logo which you can use on your payment form. For more information, refer to Downloading logos.
- Include a field where the shopper can enter the
blikCode
for their corresponding payment.
In your /paymentMethods request, specify:
- countryCode: PL
- amount.currency: PLN
- amount.value: The value of the payment, in minor units.
- channel: Specify Web, iOS, or Android.
You can find the required fields in the object with type
blik.
Make a payment
In your /payments request, specify:
paymentMethod.type
: blik-
paymentMethod.blikCode
: TheblikCode
that the shopper entered.curl https://checkout-test.adyen.com/v68/payments \ -H "x-API-key: YOUR_X-API-KEY" \ -H "content-type: application/json" \ -d '{ "merchantAccount":"YOUR_MERCHANT_ACCOUNT", "reference":"YOUR_ORDER_NUMBER", "amount":{ "currency":"PLN", "value":1000 }, "paymentMethod":{ "type":"blik", "blikCode":"777987" }, "countryCode" : "PL" }'
# Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen::Client.new adyen.api_key = "YOUR_X-API-KEY" response = adyen.checkout.payments({ :amount => { :currency => "PLN", :value => 1000 }, :reference => "YOUR_ORDER_NUMBER", :paymentMethod => { :type => "blik", :blikCode => "777987" }, :merchantAccount => "YOUR_MERCHANT_ACCOUNT" })
// Set your X-API-KEY with the API key from the Customer Area. $client = new \Adyen\Client(); $client->setXApiKey("YOUR_X-API-KEY"); $service = new \Adyen\Service\Checkout($client); $params = array( "amount" => array( "currency" => "PLN", "value" => 1000 ), "reference" => "YOUR_ORDER_NUMBER", "paymentMethod" => array( "type" => "blik", "blikCode" => "777987" ), "countryCode" => "PL", "merchantAccount" => "YOUR_MERCHANT_ACCOUNT" ); $result = $service->payments($params);
#Set your X-API-KEY with the API key from the Customer Area. adyen = Adyen.Adyen() adyen.client.xapikey = 'YOUR_X-API-KEY' result = adyen.checkout.payments({ 'amount': { 'value': 1000, 'currency': 'PLN' }, 'reference': 'YOUR_ORDER_NUMBER', 'paymentMethod': { 'type': 'blik', 'blikCode': '777987' }, 'merchantAccount': 'YOUR_MERCHANT_ACCOUNT' })
// Set your X-API-KEY with the API key from the Customer Area. const {Client, Config, CheckoutAPI} = require('@adyen/api-library'); const config = new Config(); // Set your X-API-KEY with the API key from the Customer Area. config.apiKey = '[API_KEY]'; config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]'; const client = new Client({ config }); client.setEnvironment("TEST"); const checkout = new CheckoutAPI(client); checkout.payments({ amount: { currency: "PLN", value: 1000 }, paymentMethod: { type: 'blik', blikCode: '777987' }, reference: "YOUR_ORDER_NUMBER", countryCode: "PL", merchantAccount: config.merchantAccount }).then(res => res);
The /payments response contains:
resultCode
: Pending, means the shopper needs to complete the payment in their BLIK app.action.type
: await, means you need to wait for the webhook to know the payment outcome.
Show the waiting screen
- Show a waiting screen to the shopper, telling them you're waiting for them to complete the payment.
- Check your webhooks to see the payment result. We send you an AUTHORISATION webhook after the shopper completes the payment in their BLIK app.
- Once you receive the webhook, redirect them to your website, and present the payment result.
Present the payment result
Use the resultCode
that you received in the /payments response to inform your shopper of the payment status.
The resultCode
values you can receive for payments made through BLIK are:
resultCode | Action to take |
---|---|
Pending | Show the waiting screen to the shopper, informing them that they have to go to their bank app to complete the payment. |
Refused | Inform the shopper that the payment is refused, for example, because of incorrect blikCode value. |
Wait for webhooks to know the outcome of the payment. The webhooks you can receive for BLIK are:
eventCode | success field | Description | Action to take |
---|---|---|---|
AUTHORISATION | false | The transaction failed. | Cancel the order and inform the shopper that the payment failed. |
AUTHORISATION | true | The shopper successfully completed the payment. | Inform the shopper that the payment has been successful and proceed with the order. |
Test and go live
To test BLIK, you can use any 6-digit blikCode
that starts with 777.
You can test different refused payment result scenarios by using the following amounts in your /payments request:
Refusal reason | Amount |
---|---|
ALIAS_DECLINED | 288.00 |
TAS_DECLINED | 192.00 |
USER_DECLINED | 144.00 |
SEC_DECLINED | 216.00 |
SYSTEM_ERROR | 264.00 |
GENERAL_ERROR | 360.00 |
INSUFFICIENT_FUNDS | 120.00 |
TIMEOUT | 312.00 |
LIMIT_EXCEEDED | 96.00 |
USER_TIMEOUT | 336.00 |
ISSUER_DECLINED | 9.99 |
You can check the status of BLIK test payments in your Customer Area > Transactions > Payments.
Before you can accept live BLIK payments, you need to add BLIK in your live Customer Area.