Accept BLIK payments
DocsCurrentLast updated: August 19th 2024, @ 1:50:35 am
BLIK is a payment method in Poland.
| Countries | Payment type | Payment flow | Currencies | Minimum amount | Maximum amount | Refunds |
|---|---|---|---|---|---|---|
Poland (PL) | bank | one-click | PLN | 1 PLN | 10,000 PLN | Within 180 days |
Integrate
Render payment buttons and process payments with the Orders API.
- Your checkout page offers alternative payment methods.
- Buyer provides their personal details and selects an alternative payment method from your checkout page.
- Buyer stays on your checkout page and is prompted to input their authcode and authorize the payment.
- Buyer authorizes and confirms payment.
- Buyer sees confirmation of purchase.
- PayPal moves the funds to the merchant. The transaction shows in your PayPal account with the payment method the payer used.
Note: If your checkout page offers a guest checkout experience, where the buyer doesn't need to register during the checkout process, please refer to the Blik Seamless Steps to implement the guest checkout experience.
Know before you code
Note: The integration steps for implementing alternative payment methods are similar. If you've integrated another alternative payment method before, you can likely reuse that code with adjustments for this payment method.
- Make sure you're subscribed to the following webhook events:
PAYMENT.CAPTURE.COMPLETED- Listen for this webhook to get notified about a successful order capture.PAYMENT.CAPTURE.DENIED- This webhook tells you when an order capture fails.CHECKOUT.ORDER.APPROVED- This webhook tells you when an order has been approved. Additionally, it exposes the array of customer's bank aliases.
- Make sure your preference for receiving payments in your PayPal business or merchant account is set to accept and convert to the currency in your account. In your profile, select Account Settings > Payment preferences > Block payments and click Update to mark this preference.
- When processing BLIK payments, you don't need to capture payment for the order. We perform auto-capture when the following
processing_instructionis set toORDER_COMPLETE_ON_PAYMENT_APPROVALduring the create confirm order call.
1. Offer BLIK on your checkout page
You'll need to create the user interface to offer BLIK as a payment method, then collect the buyer's auth_code and other information to authorize the transaction.
Then you'll use the API calls described in the remainder of this topic to:
- Create the order with BLIK as the
payment_source, including the buyer'sfull_nameandcountry_code. - To ensure a one-click experience, pass a
one_clickobject inside ofpayment_source.blikwith the following parameters:- For first-time customers, include
consumer_reference,auth_code, andalias_label. - For returning customers, include
consumer_referenceandalias_key. - You also need to pass the required fields
consumer_ipandconsumer_user_agentas part of theexperience_contextobject inside ofpayment_source.blik.
- For first-time customers, include
Refer to Payment method icons for icons you can use and download locations.
2. Create an order with BLIK as the payment source
2.1 First time buyer experience
Use the buyer information you captured from your user interface to create an order with BLIK as the payment source.
Sample request
API endpoint used: Create order
curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \
-H "PayPal-Request-Id: <PayPal-RequestId>" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"intent": "CAPTURE",
"processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "PLN",
"value": "100.00"
}
}
],
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050",
"auth_code": "123456",
"alias_label": "John Doe bank 1"
},
"experience_context": {
"locale": "en-PL",
"consumer_ip": "192.158.1.38",
"consumer_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0"
}
}
}
}'
Modify the code
After you copy the code in the sample request, modify the following:
PayPal-Request-Id- Replace the sample ID with a unique ID you generate. This ID helps prevent duplicate authorizations in the event that the API call is disrupted. See also: API idempotency.intent- To use an alternative payment method, this parameter must be set toCAPTUREas it is in this sample code.processing_instruction- Set this value toORDER_COMPLETE_ON_PAYMENT_APPROVALas it is in this sample code.purchase_units: amount- Pass the amount of the order and the currency code.payment_source- SpecifyBLIKas the payment method and include the country code and account holder's full name. You can optionally include the buyer's email address.one_click- Specify the 6-digitauth_codethe buyer generated from their banking app and input using the merchant-hosted UI. Additionally, include the uniqueconsumer_referencevalue that the merchant generated to identity the customer. The purpose of this unique identifier is to keep a history of the buyer’s past transactions to use for the returning customer’s experience. Please include the consumer'salias_labelto register them as a first-time buyer in the system. You can use an email address, username, or other identifying information foralias_label.experience_context- Use this object to pass the preferred language for returned errors, the customer's IP address, and the customer's user agent. You need to include the required parametersconsumer_ipandconsumer_user_agentto create a seamless transaction.
Note: Change or add other parameters in the Create order request body to create an order that reflects the actual order details.
Step result
A successful request returns the following:
- A return status code of HTTP
200 OK. - A JSON response body that contains the order ID. You'll use the order ID and
payer-actionHATEOAS URL in the next step. See also: HATEOAS links.
Sample response
{
"id": "5O190127TN364715T",
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050"
}
}
},
"links": [
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "self",
"method": "GET"
}
],
"status": "PAYER_ACTION_REQUIRED"
}
Step result
At this point the buyer should have received a notification to authorize the payment in their bank app.
After successfully completing the bank approval:
- The
PAYMENT.CAPTURE.COMPLETEDwebhook event is triggered, which indicates that payment capture was successful. Depending on your UI/UX the buyer could be redirected to a payment success page hosted by the merchant.
After an unsuccessful bank approval:
- A
422 ALIAS_DECLINED_BY_PROCESSORerror is returned as part of the Create Order response. - The
PAYMENT.CAPTURE.DENIEDwebhook is triggered, which indicates that payment capture was unsuccessful.
2.1 Returning buyer experience
2.2.1 Call GetOrder to fetch the latest aliases
In case of a returning customer, you can get the order capture result with the most up-to-date aliases by calling the Show order details endpoint. The endpoint requires an order ID that identifies the most recent PayPal order ID for the returning buyer.
Important: Exercise caution when polling for order capture results using the Show order details endpoint. PayPal enforces rate limits on API requests.
Sample request
API endpoint used: Get order
curl -v -X GET https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>"
Sample response
{
"id": "5O190127TN364715T",
"intent": "CAPTURE",
"status": "COMPLETED",
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050",
"aliases" : [
{
"key": "unique-blik-id-1",
"label": "Alias label 1"
},
{
"key": "unique-blik-id-2",
"label": "Alias label 2"
}
]
}
}
},
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"shipping": {
"address": {
"address_line_1": "ul. Radzanowska 75",
"admin_area_2": "Warszawa",
"postal_code": "95131",
"country_code": "PL"
}
},
"payments": {
"captures": [
{
"id": "3C679366HH908993F",
"status": "COMPLETED",
"amount": {
"currency_code": "PLN",
"value": "100.00"
},
"seller_protection": {
"status": "NOT_ELIGIBLE",
"dispute_categories": [ ]
},
"final_capture": true,
"disbursement_mode": "INSTANT",
"seller_receivable_breakdown": {
"gross_amount": {
"currency_code": "PLN",
"value": "100.00"
},
"paypal_fee": {
"currency_code": "PLN",
"value": "3.00"
},
"net_amount": {
"currency_code": "PLN",
"value": "97.00"
}
},
"links": [
{
"href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
"rel": "refund",
"method": "POST"
}
]
}
]
}
}
],
"links": [
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "self",
"method": "GET"
}
]
}
}
Step result
A successful request returns the HTTP 200 OK status code with a JSON response body that passes a COMPLETED status.
A successfully captured order has the following elements:
- The order status is
COMPLETED, which means the order was captured successfully. - The order response includes
payment_source.blik.one_click.aliases, an array of key-value pairs representing the alias label and alias key of all the buyer's registered banks. These aliases allow returning customers to use theirconsumer_referenceidentifier to select a bank for authorization without needing to enter anauth_code. - A capture that passes the
COMPLETEDstatus in the response parameterpurchase_units[0].payments.captures[0]. - The
upHATEOAS link indicates the order associated with this capture.
2.2.2 Create Order
Use the buyer information you captured from your user interface to create an order with BLIK as the payment source.
Sample request
API endpoint used: Create order
curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders \
-H "PayPal-Request-Id: <PayPal-RequestId>" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"intent": "CAPTURE",
"processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "PLN",
"value": "100.00"
}
}
],
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050",
"alias_key": "847139234567"
},
"experience_context": {
"locale": "en-PL",
"consumer_ip": "192.158.1.38",
"consumer_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0"
}
}
}
}'
Modify the code
After you copy the code in the sample request, modify the following:
PayPal-Request-Id- Replace the sample ID with a unique ID you generate. This ID helps prevent duplicate authorizations in the event that the API call is disrupted. See also: API idempotencyintent- To use an alternative payment method, this parameter must be set toCAPTUREas it is in this sample code.processing_instruction- Set this value toORDER_COMPLETE_ON_PAYMENT_APPROVALas it is in this sample code.purchase_units: amount- Pass the amount of the order and the currency code.payment_source- Specifyblikas the payment method and include the country code and account holder's full name. You can optionally include the buyer's email address.one_click- Specify thealias_keythe buyer generated from their banking app and input using the merchant-hosted UI. Additionally, include the uniqueconsumer_referencevalue that the merchant generated to identity the customer. The purpose of this unique identifier is to keep a history of the buyer’s past transactions to use for the returning customer’s experience.experience_context- Use this object to pass the preferred language for returned errors, the customer's IP address, and the customer's user agent. You need to include the required parametersconsumer_ipandconsumer_user_agentto create a seamless transaction.
Note: Change or add other parameters in the Create order request body to create an order that reflects the actual order details.
Step result
A successful request results in the following:
- A return status code of HTTP
200 OK. - A JSON response body that contains the order ID. You'll use the order ID and
payer-actionHATEOAS URL in the next step. See also: HATEOAS links.
Sample response
{
"id": "5O190127TN364715T",
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050",
"aliases" : [
{
"key": "unique-blik-id-1",
"label": "Alias label 1"
},
{
"key": "unique-blik-id-2",
"label": "Alias label 2"
}
]
}
}
},
"links": [
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "self",
"method": "GET"
}
],
"status": "PAYER_ACTION_REQUIRED"
}
Step result
After successfully completing the bank approval:
Depending on your UI/UX the buyer could be redirected to a payment success page hosted by the merchant.
- The
PAYMENT.CAPTURE.COMPLETEDwebhook event is triggered, which indicates that payment capture was successful.
After unsuccessful bank approval:
- A
422 ALIAS_DECLINED_BY_PROCESSORerror is returned as part of the Create Order response.
3. Listen to webhooks to get the result of payment status
Listen to the following webhooks to get the result of order capture:
- The
PAYMENT.CAPTURE.COMPLETEDwebhook event indicates a successful order capture. - The
PAYMENT.CAPTURE.DENIEDwebhook events indicate a failed order capture. - Optional: Use Show order details endpoint to determine the status of an order.
- The
upHATEOAS link indicates the order associated with this capture.
- The
See Subscribe to checkout webhooks for more information.
Here are some additional resources as you create webhook handler code:
- Webhook Management API - Manage webhooks, list event notifications, and more.
- Webhook events
- Checkout webhook events - Checkout buyer approval-related webhooks.
- Order webhook events - Other order-related webhooks.
- Show order details endpoint - Determine the status of an order.
Sample CHECKOUT.ORDER.APPROVED webhook
{
"id": "WH-7G789681KR602253C-8PB12362Y9183183R",
"event_version": "1.0",
"create_time": "2024-06-27T09:57:10.895Z",
"resource_type": "checkout-order",
"resource_version": "2.0",
"event_type": "CHECKOUT.ORDER.APPROVED",
"summary": "An order has been approved by buyer",
"resource": {
"create_time": "2024-06-27T09:56:56Z",
"processing_instruction": "ORDER_COMPLETE_ON_PAYMENT_APPROVAL",
"payment_source": {
"blik": {
"name": "FRANK ALIAS 1",
"country_code": "PL",
"email": "[email protected]",
"one_click": {
"consumer_reference": "consumer_ref_123456789",
"aliases" : [
{
"key": "unique-blik-id-1",
"label": "Alias label 1"
},
{
"key": "unique-blik-id-2",
"label": "Alias label 2"
}
]
}
}
},
"intent": "CAPTURE",
"status": "APPROVED",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "PLN",
"value": "100.00"
},
"payee": {
"email_address": "[email protected]",
"merchant_id": "GHZWJWE7D625L"
}
}
],
"links": [
{
"href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/30P10948XE539523X",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/30P10948XE539523X",
"rel": "update",
"method": "PATCH"
},
{
"href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/30P10948XE539523X/capture",
"rel": "capture",
"method": "POST"
}
],
"id": "30P10948XE539523X"
},
"links": [
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-7G789681KR602253C-8PB12362Y9183183R",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-7G789681KR602253C-8PB12362Y9183183R/resend",
"rel": "resend",
"method": "POST"
}
]
}
Sample PAYMENT.CAPTURE.COMPLETED webhook
{
"id": "WH-2B342482FC0449155-12X09416XP387753C",
"event_version": "1.0",
"zts": 1481046241,
"create_time": "2022-04-05T10:37:05Z",
"resource_type": "capture",
"resource_version": "2.0",
"event_type": "PAYMENT.CAPTURE.COMPLETED",
"summary": "Payment completed for PLN 1.00 PLN",
"resource": {
"amount": {
"currency_code": "PLN",
"value": "1.00"
},
"create_time": "2022-04-05T10:37:05Z",
"update_time": "2022-04-05T10:37:05Z",
"final_capture": true,
"seller_receivable_breakdown": {
"paypal_fee": {
"value": "0.20",
"currency_code": "PLN"
},
"gross_amount": {
"value": "1.00",
"currency_code": "PLN"
},
"net_amount": {
"value": "0.80",
"currency_code": "PLN"
}
},
"links": [
{
"method": "GET",
"rel": "self",
"href": "https://api-m.sandbox.paypal.com/v2/payments/captures/8SS60826HT082593F"
},
{
"method": "POST",
"rel": "refund",
"href": "https://api-m.sandbox.paypal.com/v2/payments/captures/8SS60826HT082593F/refund"
},
{
"method": "GET",
"rel": "up",
"href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/7S180378AE2002441"
}
],
"id": "8SS60826HT082593F",
"status": "COMPLETED"
},
"links": [
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2B342482FC0449155-12X09416XP387753C",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2B342482FC0449155-12X09416XP387753C/resend",
"rel": "resend",
"method": "POST"
}
]
}
Note: The order ID from Step 2 should match
resource.supplementary_data.related_ids.order_idparameter in the webhook payload.
Sample PAYMENT.CAPTURE.DENIED webhook
{
"id": "WH-2B342482FC0449155-12X09416XP387753C",
"event_version": "1.0",
"create_time": "2022-04-05T10:37:05Z",
"resource_type": "capture",
"resource_version": "2.0",
"event_type": "PAYMENT.CAPTURE.DENIED",
"summary": "Payment denied for PLN 1.00 PLN",
"resource": {
"amount": {
"value": "1.00",
"currency_code": "PLN"
},
"supplementary_data": {
"related_ids": {
"order_id": "7S180378AE2002441"
}
},
"create_time": "2022-04-05T10:37:05Z",
"update_time": "2022-04-05T10:37:05Z",
"final_capture": true,
"seller_receivable_breakdown": {
"paypal_fee": {
"value": "0.20",
"currency_code": "PLN"
},
"gross_amount": {
"value": "1.00",
"currency_code": "PLN"
},
"net_amount": {
"value": "0.80",
"currency_code": "PLN"
}
},
"links": [
{
"method": "GET",
"rel": "self",
"href": "https://api-m.sandbox.paypal.com/v2/payments/captures/8SS60826HT082593F"
},
{
"method": "POST",
"rel": "refund",
"href": "https://api-m.sandbox.paypal.com/v2/payments/captures/8SS60826HT082593F/refund"
},
{
"method": "GET",
"rel": "up",
"href": "https://api-m.sandbox.paypal.com/v2/checkout/orders/7S180378AE2002441"
}
],
"id": "8SS60826HT082593F",
"status": "DECLINED"
},
"links": [
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2B342482FC0449155-12X09416XP387753C",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.sandbox.paypal.com/v1/notifications/webhooks-events/WH-2B342482FC0449155-12X09416XP387753C/resend",
"rel": "resend",
"method": "POST"
}
]
}
Note: The order ID from Step 2 should match
resource.supplementary_data.related_ids.order_idparameter in the webhook payload.
Alternatively, if your app misses the webhook needed to capture the order, you can get the order capture result by sending a GET call to the Show order details endpoint of the Orders v2 API.
Important: Exercise caution when polling for order capture results using the Show order details endpoint. PayPal enforces rate limits on API requests.
Sample request
curl -v -X GET https://api-m.sandbox.paypal.com/v2/checkout/orders/5O190127TN364715T \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>"
Sample response
{
"id": "5O190127TN364715T",
"intent": "CAPTURE",
"status": "COMPLETED",
"payment_source": {
"blik": {
"country_code": "PL",
"name": "John Doe",
"email": "[email protected]",
"one_click": {
"consumer_reference": "customer_4029352050",
"aliases" : [
{
"key": "unique-blik-id-1",
"label": "Alias label 1"
},
{
"key": "unique-blik-id-2",
"label": "Alias label 2"
}
]
}
}
},
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"shipping": {
"address": {
"address_line_1": "ul. Radzanowska 75",
"admin_area_2": "Warszawa",
"postal_code": "95131",
"country_code": "PL"
}
},
"payments": {
"captures": [
{
"id": "3C679366HH908993F",
"status": "COMPLETED",
"amount": {
"currency_code": "PLN",
"value": "100.00"
},
"seller_protection": {
"status": "NOT_ELIGIBLE",
"dispute_categories": [ ]
},
"final_capture": true,
"disbursement_mode": "INSTANT",
"seller_receivable_breakdown": {
"gross_amount": {
"currency_code": "PLN",
"value": "100.00"
},
"paypal_fee": {
"currency_code": "PLN",
"value": "3.00"
},
"net_amount": {
"currency_code": "PLN",
"value": "97.00"
}
},
"links": [
{
"href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.paypal.com/v2/payments/captures/3C679366HH908993F/refund",
"rel": "refund",
"method": "POST"
}
]
}
]
}
}
],
"links": [
{
"href": "https://api-m.paypal.com/v2/checkout/orders/5O190127TN364715T",
"rel": "self",
"method": "GET"
}
]
}
}
Step result
A successful request returns the HTTP 200 OK status code with a JSON response body that returns a COMPLETED status.
A successfully captured order has the following:
- The order status as
COMPLETED, which means the order was captured successfully. - A capture with
COMPLETEDstatus is present in the response parameterpurchase_units[0].payments.captures[0]. - The
upHATEOAS link indicates the order associated with this capture.
4. Notify buyer of success
After a successful payment, notify the buyer of a successful transaction. You can do this by sending a confirmation email.