# BLIK for Unified Payments API To accept BLIK payments, the customer enters the BLIK code in your checkout page, and you send it to Checkout.com when you request a payment. Your customer then confirms the payment using their online banking app. 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. --- ## Request a payment Call the [Request a payment](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) 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` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` ### Request example ```json { "source": { "type": "blik" }, "amount": 1099, "currency": "PLN", "payment_type": "Regular", "reference": "ORD-5023-4E89", "processing": { "partner_code": "999111" }, "risk": { "device": { "network": { "ipv4": "192.0.2.1", "ipv6": "2001:db8:1:2:3:4:5:6" } } } } ``` In the request body, provide the BLIK code in the `processing.partner_code` field. To improve your acceptance rate, include a reference to your payment in the `reference` field. ### 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": "ORD-5023-4E89", "payment_type": "Regular", "processing": { "partner_payment_id": "88294496710" } } ``` --- ## Request a recurring payment Before you can request a recurring payment, you must be onboarded by BLIK to accept recurring payments. For more details, see [Onboarding](https://www.checkout.com/docs/payments/add-payment-methods/blik.md#Onboarding). Call the [Request a payment](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) 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` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments` Set the following fields, depending on the recurring model and when you want to set up the agreement. For more information about each model, see [Recurring models](https://www.checkout.com/docs/payments/add-payment-methods/blik.md#Recurring-models). **Model O (Variable)** Use Model O when the amount or frequency of future merchant-initiated transactions (MITs) is variable or unknown at agreement creation. For example, usage-based billing or marketplace top-ups. **Before the initial payment** - `source.type` – Set to `blik`. - `payment_type` – Set to `Recurring`. - `merchant_initiated` – Set to `false`. - `amount` – Set to `0`. - `payment_plan.amount_variability` – Set to `Variable`. - `payment_plan.name` – The display name shown in the customer's banking app. - `payment_plan.expiry` – The expiry date of the agreement, in `YYYYMMDD` format. - `payment_plan.start_date` – The date of the first scheduled payment, in `YYYYMMDD` format. > **Information** > > When setting up the agreement before the initial payment, `payment_plan.start_date` is mandatory. #### Request example ```json { "source": { "type": "blik" }, "amount": 0, "currency": "PLN", "payment_type": "Recurring", "payment_plan": { "amount_variability": "Variable", "expiry": "20251231", "start_date": "20251114", "name": "Internet Subscription 123456" }, "reference": "ORD-5023-4E89", "merchant_initiated": false, "processing": { "partner_code": "999009" } } ``` **During the initial payment** - `source.type` – Set to `blik`. - `payment_type` – Set to `Recurring`. - `merchant_initiated` – Set to `false`. - `payment_plan.amount_variability` – Set to `Variable`. - `payment_plan.name` – The display name shown in the customer's banking app. - `payment_plan.expiry` – The expiry date of the agreement, in `YYYYMMDD` format. #### Request example ```json { "source": { "type": "blik" }, "amount": 999, "currency": "PLN", "payment_type": "Recurring", "payment_plan": { "amount_variability": "Variable", "expiry": "20251231", "name": "Internet Subscription 123456" }, "reference": "ORD-5023-4E89", "merchant_initiated": false, "processing": { "partner_code": "999009" } } ``` #### Response example If you receive a `202 Accepted` response, your request was successful. A successful response contains the following fields: - `id` – The payment ID. - `source.id` – The payment instrument ID. You can use this ID to process subsequent payments, or retrieve the BLIK PayID from the `source.partner_agreement_id` field. - `source.partner_agreement_id` – Your BLIK PayID, which you can also use to process subsequent payments. - `status` – Set to `Pending`. ```json { "id": "pay_kiexvrgdqwzedjr4zwkkkukwwu", "status": "Pending", "reference": "ORD-5023-4E89", "payment_type": "Recurring", "processing": { "partner_payment_id": "90231815793" }, "source": { "id": "src_1233457", "partner_agreement_id": "777001" }, "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_kiexvrgdqwzedjr4zwkkkukwwu" } } } ``` **Model A (Fixed)** Use Model A when the amount and frequency of future MITs are known at agreement creation. For example, a 12-month plan billed at a fixed amount every 30 days. Model A does not use the `payment_plan.expiry` field. The agreement lifecycle is bounded by `payment_plan.total_number_of_payments` multiplied by `payment_plan.days_between_payments`. **Before the initial payment** - `source.type` – Set to `blik`. - `payment_type` – Set to `Recurring`. - `merchant_initiated` – Set to `false`. - `amount` – Set to `0`. - `payment_plan.amount_variability` – Set to `Fixed`. - `payment_plan.name` – The display name shown in the customer's banking app. - `payment_plan.amount` – The fixed amount charged on each MIT. Required when the top-level `amount` is `0`. - `payment_plan.total_number_of_payments` – The total number of payments in the agreement. - `payment_plan.days_between_payments` – The interval in days between payments. - `payment_plan.start_date` – The date of the first scheduled payment, in `YYYYMMDD` format. #### Request example ```json { "source": { "type": "blik" }, "amount": 0, "currency": "PLN", "payment_type": "Recurring", "payment_plan": { "amount_variability": "Fixed", "name": "Testing plan", "total_number_of_payments": 12, "days_between_payments": 30, "amount": 1234, "start_date": "20260501" }, "reference": "ORD-5023-4E89", "merchant_initiated": false, "processing": { "partner_code": "999009" } } ``` #### Response example ```json { "id": "pay_trfjlsyb2vhy7dzvthb7ksplsy", "status": "Pending", "reference": "ORD-5023-4E89", "source": { "id": "src_h452unyc5pyelgwkf5o3f2q7am", "type": "blik", "partner_agreement_id": "src_h452unyc5pyelgwkf5o3f2q7am" }, "payment_type": "Recurring", "processing": { "partner_payment_id": "90888101473" }, "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_trfjlsyb2vhy7dzvthb7ksplsy" } } } ``` **During the initial payment** - `source.type` – Set to `blik`. - `payment_type` – Set to `Recurring`. - `merchant_initiated` – Set to `false`. - `amount` – The amount of the initial payment. - `payment_plan.amount_variability` – Set to `Fixed`. - `payment_plan.name` – The display name shown in the customer's banking app. - `payment_plan.total_number_of_payments` – The total number of payments in the agreement. - `payment_plan.days_between_payments` – The interval in days between payments. #### Request example ```json { "source": { "type": "blik" }, "amount": 1234, "currency": "PLN", "payment_type": "Recurring", "payment_plan": { "amount_variability": "Fixed", "name": "Testing plan", "total_number_of_payments": 12, "days_between_payments": 30 }, "reference": "ORD-5023-4E89", "merchant_initiated": false, "processing": { "partner_code": "999009" } } ``` #### Response example If you receive a `202 Accepted` response with a payment `id`, a `source.id`, a `source.partner_agreement_id`, and `status` set to `Pending`, your request was successful. ```json { "id": "pay_puo323abzwwyppiafaqxvvklii", "status": "Pending", "reference": "ORD-5023-4E89", "source": { "id": "src_y6itvxkrylzute7wqccofp7ayi", "type": "blik", "partner_agreement_id": "src_y6itvxkrylzute7wqccofp7ayi" }, "payment_type": "Recurring", "processing": { "partner_payment_id": "90888101411" }, "_links": { "self": { "href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_puo323abzwwyppiafaqxvvklii" } } } ``` --- ## Get details about a BLIK agreement The agreement finalizes after the payment or agreement successfully authorizes in your customer's banking app. You can retrieve the status of the payment or agreement via webhook or by calling the [Get instrument details](https://api-reference.checkout.com/tag/Instruments/#operation/getInstrumentDetails) endpoint, and setting the `source.id` value from the payment response as the `{id}` path parameter: > **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** `GET` `https://{prefix}.api.checkout.com/instruments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/instruments/{id}` ### Response example ```json { "type": "blik", "instrument_data": { "agreement_id": "9d45c3f7-7bce-4f03-85a8-d2464a826fce", "status": "VALID", "reason": "", "amount_variability": "Variable", "currency": "PLN", "partner_agreement_id": "src_kjhuc4ejrpreplip5tj2rljlty", "name": "test subscription", "expiry": "20270101", "start_date": "20250101" }, "metadata": { "merchant_id": "memowvltf7aulpb" }, "account": { "entity_id": "ent_kjhuc4ejrpreplip5tj2rljlty", "client_id": "cli_kjhuc4ejrpreplip5tj2rljlty" } } ``` --- ## Set up subsequent requests You can request a recurring payment using either: - A Checkout.com managed payment instrument - The BLIK PayID stored on your side Call the [Request a payment](https://api-reference.checkout.com/tag/Payments/#operation/requestAPaymentOrPayout) endpoint. In the request body, provide the following: **Payment instrument** - `source.type` – Set to `id` - `source.id` – The payment instrument ID you received in the initial payment response, or the ID of the instrument created to store the agreement. #### Request example ```json { "source": { "id": "src_jwvjl5tin54ubn7x2stvmunske", "type": "id" }, "amount": 999, "currency": "PLN", "payment_type": "Recurring", "reference": "ORD-5023-4E89", "merchant_initiated": true } ``` **BLIK PayID** - `source.type` – Set to `blik` - `source.partner_agreement_id` – The BLIK PayID - `payment_plan.name` – The BLIK PayID alias label you created when creating the agreement. #### Request example ```json { "source": { "type": "blik", "partner_agreement_id": "cde12i39" }, "amount": 999, "currency": "PLN", "payment_type": "Recurring", "payment_plan": { "name": "Subscription 111" }, "reference": "ORD-5023-4E89", "merchant_initiated": true } ``` --- ## Get details about a payment To retrieve details about the payment, call the [Get payment details](https://api-reference.checkout.com/tag/Payments/#operation/getPaymentDetails) endpoint, setting the `payment_id` value from the payment response as the `{id}` path parameter: **Production** `GET` `https://{prefix}.api.checkout.com/payments/{id}` **Sandbox** `GET` `https://{prefix}.api.sandbox.checkout.com/payments/{id}` --- ## Refund a payment BLIK supports both partial and full refunds. You can refund the payment in the [Dashboard](https://dashboard.checkout.com) or by calling the [Refund a payment](https://api-reference.checkout.com/tag/Payments/#operation/refundAPayment) endpoint, setting the `payment_id` value from the payment response as the `{id}` path parameter: **Production** `POST` `https://{prefix}.api.checkout.com/payments/{id}/refunds` **Sandbox** `POST` `https://{prefix}.api.sandbox.checkout.com/payments/{id}/refunds` In the request body, provide the original payment's reference ID in the `reference` field. ```json { "amount": 20, "reference": "ORD-5023-4E89" } ``` ### Response example ```json { "action_id": "act_c4x2vjvnx4uelb4io72fa4e57a", "_links": { "payment": { "href": "https://{prefix}.api.checkout.com/payments/pay_fzzdurog3squjj2ityho7x3o64" } } } ``` --- ## Void a payment 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. For more information, see [Void a payment](https://www.checkout.com/docs/payments/manage-payments/void-a-payment.md). --- ## Test your integration You can simulate different outcomes by sending a payment request to your sandbox environment. You can test regular and recurring payments by setting the `processing.partner_code` field to specific values. ### Test regular payments To test a regular payment, send a payment request setting the `processing.partner_code` field to any of the following values, depending on the outcome you want to test: | Outcome | Payment status | Webhook event | Partner code | | --- | --- | --- | --- | | `AUTHORIZED` | Captured | `payment_captured` | `999111` | | `TAS_DECLINED` | Declined | `payment_declined` | `927111` | | `USER_DECLINED` | Canceled | `payment_voided` | `934111` | | `SEC_DECLINED` | Declined | `payment_declined` | `969111` | | `SYSTEM_ERROR` | Declined | `payment_declined` | `956111` | | `GENERAL_ERROR` | Declined | `payment_declined` | `961111` | | `INSUFFICIENT_FUNDS` | Declined | `payment_declined` | `960111` | | `TIMEOUT` | Declined | `payment_declined` | `989111` | | `LIMIT_EXCEEDED` | Declined | `payment_declined` | `990111` | | `USER_TIMEOUT` | Expired | `payment_expired` | `949111` | | `ISSUER_DECLINED` | Declined | `payment_declined` | `902111` | | `INCORRECT_PARTNER_CODE_SYNCHRONOUS_ERROR` | Sync error. No payment created | | `123456` | ### Test recurring payments To test recurring payments, you must first simulate a BLIK Recurring instrument creation: In the payment request, set: - `amount` to `49500` - `reference` to `mock` Then, send a an initial payment request using one of the following `partner_code` values, and a subsequent payment request using the corresponding `amount` value. | Outcome | Payment status | Webhook event | Partner code for initial payment | Subsequent payment amount | | --- | --- | --- | --- | --- | | `AUTHORIZED` | Captured | `payment_captured` | `999009` | `1234` | | `ALIAS_DECLINED` | Declined | `payment_declined` | `912009` | `28800` | | `TAS_DECLINED` | Declined | `payment_declined` | `927009` | `19200` | | `USER_DECLINED` | Canceled | `payment_voided` | `934009` | `14400` | | `SEC_DECLINED` | Declined | `payment_declined` | `969009` | `21600` | | `SYSTEM_ERROR` | Declined | `payment_declined` | `956009` | `26400` | | `GENERAL_ERROR` | Declined | `payment_declined` | `961009` | `36000` | | `INSUFFICIENT_FUNDS` | Declined | `payment_declined` | `960009` | `12000` | | `TIMEOUT` | Declined | `payment_declined` | `989009` | `31200` | | `LIMIT_EXCEEDED` | Declined | `payment_declined` | `990009` | `9600` | | `USER_TIMEOUT` | Expired | `payment_expired` | `949009` | `33600` | | `ISSUER_DECLINED` | Declined | `payment_declined` | `902009` | `16800` | | `INCORRECT_PARTNER_CODE_SYNCHRONOUS_ERROR` | Sync error. No payment created | | `123456` | |