# BLIK for Payment Setup API To accept BLIK payments, you must: 1. Create a payment setup. 2. Confirm the payment. 3. Redirect the customer to BLIK. When integrating with BLIK, you must follow [their UX guidelines](https://www.blik.com/lp/payment-without-code/Level-0-Oneclick-Checklist.141951240.html#Level0OneclickChecklist-Level0-guidelinesforimplementationofBLIKwithcode). This compliance is a requirement for onboarding. If you do not follow these guidelines, we cannot approve you for production. --- ## Create a payment setup Call the [Create a payment setup](https://api-reference.checkout.com/tag/Payment-Setups/#operation/createAPaymentSetup) endpoint. > **Information** > > Your base URL's `{prefix}` value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see [API endpoints](https://www.checkout.com/docs/developer-resources/api/api-endpoints.md). **Production** `POST` `https://{prefix}.api.checkout.com/payments/setups` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups` ### Request example ```json { "amount": 1099, "currency": "PLN", "reference": "ORDER_01234", "processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4", "payment_methods": { "blik": { "partner_code": "999111" } }, "settings": { "success_url": "https://example.com/payments/success", "failure_url": "https://example.com/payments/failure" } } ``` In the request body, provide the following: | Field | Description | | --- | --- | | `amount`
`number` | The payment amount, in the [minor currency unit](https://www.checkout.com/docs/payments/accept-payments/format-the-amount-value).

Minimum: 1

Maximum: 5000000

**Required** | | `currency`
`string` | Three-letter ISO 4217 [currency code](https://www.checkout.com/docs/developer-resources/codes/currency-codes.md).

Supported value: `PLN`

**Required** | | `payment_methods.blik.partner_code`
`string` | The six-digit BLIK code the customer entered on your checkout page.

Format: `^[0-9]{6}$`

**Required** | | `processing_channel_id`
`string` | The [processing channel's](https://www.checkout.com/docs/business-operations/use-the-dashboard/manage-processing-channels.md) unique identifier.

**Required** | | `reference`
`string` | A unique reference for the payment.

Max length: 35

**Required** | | `settings.failure_url`
`string` | The URL to redirect the customer to if the payment fails.

Format: URI

Max length: 1024

**Required** | | `settings.success_url`
`string` | The URL to redirect the customer to if the payment succeeds.

Format: URI

Max length: 1024

**Required** | | `description`
`string` | A description of the payment.

Max length: 100 | | `order.shipping.address.country`
`string` | The two-letter [ISO country code](https://www.checkout.com/docs/developer-resources/codes/country-codes.md) of the shipping address. | ### Response example ```json { "id": "set_rcmepwrchqab2wsergcafvijfy", "processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4", "amount": 1099, "currency": "PLN", "payment_type": "Regular", "reference": "ORDER_01234", "description": "BLIK payment", "payment_methods": { "blik": { "status": "ready", "flags": [] } }, "available_payment_methods": [ "blik" ], "settings": { "success_url": "https://example.com/payments/success", "failure_url": "https://example.com/payments/failure" } } ``` The response returns a `payment_methods` object, which contains the payment methods enabled on your account. Providing all required fields sets the `payment_methods.blik` object to a `ready` [status](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-using-the-payment-setup-api.md#Payment_method_status). --- ## Confirm the payment Confirm the payment by calling the [Confirm a payment setup](https://api-reference.checkout.com/tag/Payment-Setups/#operation/confirmAPaymentSetup) endpoint and provide: - The payment setup `id` as the `{id}` path parameter. - `blik` as the `{payment_method_name}` path parameter. ### Request example **Production** `POST` `https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/blik` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments/setups/{id}/confirm/blik` ### Response example If you receive a `202 Accepted` response with a payment `id` value and the `status` field set to `Pending`, your request was successful. ```json { "id": "pay_jwvjl5tin54ubn7x2stvmunske", "status": "Pending", "reference": "ORDER_01234", "payment_type": "Regular", "processing": { "partner_payment_id": "88294496710" } } ``` --- ## Redirect the customer The customer confirms the payment using their online banking app. They are then redirected back to your `settings.success_url` or `settings.failure_url`. Confirmation of a BLIK payment is communicated through webhooks. All payments are labeled as _Pending_ until you receive a `payment_captured` webhook, indicating a successful transaction. If the customer does not complete the payment, it expires and you receive a `payment_expired` webhook within five minutes. If the customer cancels their payment, you also receive a `payment_expired` webhook.