Integrating BLIK Payments
How you call the PayU API depends on the integration method. This page describes the order extensions required in each BLIK scenario.
In each integration type, you create a standard order extended with fields specific to that integration.
Request Headers
Include the Authorization header with the OAuth token and set the Content-Type header to application/json:
-H "Authorization: Bearer <OAuth token for grant_type=client_credentials/trusted_merchant>" \
-H "Content-Type: application/json"
Redirecting to the BLIK Page
Authenticate the request with an OAuth token obtained with grant_type=client_credentials and include it in the Authorization header.
Order Extension
Because redirecting the buyer to the BLIK payment page works like a pay-by-link payment, add the payMethods section to the standard order and set type to PBL and value to blik:
"payMethods": {
"payMethod": {
"type": "PBL",
"value": "blik"
}
}
Response Examples
{
"status": {
"statusCode": "SUCCESS"
},
"redirectUri": "<redirection address>",
"orderId": "<id of created order>"
}
BLIK Payment with Authorization Code
Authenticate the request with an OAuth token obtained with grant_type=client_credentials and include it in the Authorization header.
Order Extension
Add the payMethods section to the standard order and set type to BLIK_AUTHORIZATION_CODE and value to the BLIK authorization code generated by the buyer.
Include the countryCode field set to SK if the payment is initiated on the Slovak market. You can omit it for payments on the Polish market.
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "<BLIK authorization code>",
"blikData": {
"countryCode": "SK"
}
}
}
For details about the payMethod object, see the Create an Order section in our API Reference.
Response Examples
- Positive Response
- Negative Response
{
"status": {
"statusCode": "SUCCESS"
},
"orderId": "<id of created order>"
}
{
"status": {
"statusCode": "<error group code>",
"codeLiteral": "<error code>",
"statusDesc": "<error description>"
},
"orderId": "<id of the created order>"
}
| HTTP Status | Description | |
|---|---|---|
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_EXPIRED | The authorization code has expired. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_EXCEEDED | The limit of the authorization code has been exceeded. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_CANCEL | The authorization code has been canceled. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_USED | The authorization code has been used already. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_INVALID | Incorrect authorization code. |
400 | ERROR_VALUE_INVALID / INVALID_BLIK_CODE | Syntactically incorrect BLIK authorization code. BLIK authorization code should consist of 6 digits. |
400 | ERROR_VALUE_INVALID / INVALID_AUTHORIZATION_CODE_USAGE | authorizationCode field cannot be used in this context. |
400 | ERROR_VALUE_INVALID / INVALID_ALIAS_LABEL_PROPOSAL_USAGE | aliasLabelProposal field cannot be used during token payment. |
400 | ERROR_VALUE_INVALID / INVALID_RECOMMENDED_AUTH_LEVEL_USAGE | recommendedAuthLevel field cannot be used in this context. |
400 | ERROR_VALUE_INVALID / INVALID_APP_KEY_USAGE | appKey field cannot be used in this context. |
400 | ERROR_VALUE_MISSING / MISSING_AUTHORIZATION_CODE | Validation error, the authorization code is expected. |
400 | ERROR_VALUE_MISSING / INVALID_CURRENCY_CODE | Incorrect currency code. Supported currency: PLN. |
400 | ERROR_VALUE_MISSING / MISSING_BUYER_EMAIL | Validation error, missing email field in buyer section. |
BLIK Payment with Authorization Code and the UID Token Registration
Authenticate the request with an OAuth token obtained with grant_type=trusted_merchant and include it in the Authorization header.
One BLIK token can be associated with up to 5 bank mobile applications.
Order Extension
Extend the standard order with a buyer section containing the extCustomerId and email fields, and with a payMethods section containing the blikData object with register set to true.
Include the countryCode field set to SK if the payment is initiated on the Slovak market. You can omit it for payments on the Polish market.
"buyer": {
"extCustomerId": "<customer identifier in merchant system>",
"email": "<customer email address>"
},
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "<BLIK authorization code>",
"blikData": {
"aliasLabelProposal":"<label proposal given by a merchant>",
"register": true,
"countryCode": "SK"
}
}
}
For details about the payMethod object, see the Create an Order section in our API Reference.
Response Examples
- Positive Response
- Negative Response
{
"status": {
"statusCode": "SUCCESS"
},
"orderId": "<identifier of the created order>"
}
{
"status": {
"statusCode": "<error group code>",
"codeLiteral": "<error code>",
"statusDesc": "<error description>"
},
"orderId": "<identifier of the created order>",
"blikData": {
// specific data dependent on a particular error
}
}
| HTTP Status | Description | |
|---|---|---|
400 | BUSINESS_ERROR / TOKEN_PAYMENT_NOT_ALLOWED | The token payment process requires additional arrangements and configuration. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_EXPIRED | The authorization code has expired. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_LIMIT_EXCEEDED | The limit of the authorization code has been exceeded. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_CANCEL | The authorization code has been canceled. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_USED | The authorization code has been used already. |
400 | ERROR_AUTHORIZATION_CODE / AUTH_CODE_INVALID | Incorrect authorization code. |
400 | ERROR_VALUE_MISSING / MISSING_AUTHORIZATION_CODE | Validation error, the authorization code is expected. |
400 | ERROR_VALUE_INVALID / INVALID_BLIK_CODE | Syntactically incorrect BLIK authorization code. BLIK authorization code should consist of 6 digits. |
400 | ERROR_VALUE_INVALID / INVALID_AUTHORIZATION_CODE_USAGE | authorizationCode field cannot be used in this context. |
400 | ERROR_VALUE_INVALID / INVALID_RECOMMENDED_AUTH_LEVEL_USAGE | recommendedAuthLevel field cannot be used in this context. |
400 | ERROR_VALUE_INVALID / INVALID_APP_KEY_USAGE | appKey field cannot be used in this context. |
400 | ERROR_VALUE_MISSING / INVALID_CURRENCY_CODE | Incorrect currency code. Supported currency: PLN. |
400 | ERROR_VALUE_MISSING / MISSING_BUYER_EMAIL | Validation error, missing email field in buyer section. |
400 | ERROR_VALUE_MISSING / MISSING_BUYER_EXT_CUSTOMER_ID | Validation error, missing extCustomerId field in buyer section. |
400 | ERROR_TOKEN / AUTH_TOKEN_EXISTS | User with given extCustomerId already has an active payment token with a different value. When the user has another active token, it should be retrieved via paymethods. If the user has another token that has not been saved, a tokens array with the token value will appear in the response in the blikData object. |
400 | ERROR_TOKEN / AUTH_TOKEN_NOT_ACTIVE | Used payment token has not been saved by the customer. |
BLIK Payment with UID Token
Authenticate the request with an OAuth token obtained with grant_type=trusted_merchant and include it in the Authorization header.
Order Extension
Extend the standard order with a buyer section containing the extCustomerId and email fields, and with a payMethods section containing the blikData object with the identifier of the selected banking application and the recommended authorization level.
Include the countryCode field set to SK if the payment is initiated on the Slovak market. You can omit it for payments on the Polish market.
"buyer": {
"extCustomerId": "<customer identifier in the merchant system>",
"email": "<customer email address>"
},
"payMethods": {
"payMethod": {
"type": "BLIK_TOKEN",
"value": "<value of the token used for the authorization>",
"blikData": {
"appKey":"<identifier of the associated bank's mobile application>",
"recommendedAuthLevel":"<NO_CONFIRMATION|REQUIRED_CONFIRMATION>",
"countryCode": "SK"
}
}
}
For details about the payMethod object, see the Create an Order section in our API Reference.
Response Examples
- Positive Response
- Negative Response
{
"status": {
"statusCode": "SUCCESS"
},
"orderId": "<identifier of the created order>"
}
{
"status": {
"statusCode": "<error group code>",
"codeLiteral": "<error code>",
"statusDesc": "<error description>"
},
"orderId": "<identifier of the created order>",
"blikData": {
// specific data dependent on the particular error
}
}
| HTTP Status | Description | |
|---|---|---|
400 | ERROR_TOKEN / AUTH_TOKEN_NOT_FOUND | Specified payment token does not exist. |
400 | ERROR_TOKEN / AUTH_TOKEN_NONUNIQUE | Used payment token is associated with multiple mobile banking applications. It is required to specify the specific mobile application to which the authorization request will be sent. A list of banking applications assigned to the token will be returned along with an error in the OrderCreateResponse, in the blikData section. |
400 | ERROR_VALUE_MISSING / INVALID_CURRENCY_CODE | Incorrect currency code. Supported currency: PLN. |
400 | ERROR_VALUE_MISSING / MISSING_APPKEY | Validation error, bank's mobile application identifier is missing. |
400 | ERROR_VALUE_MISSING / MISSING_BUYER_EMAIL | Validation error, email field missing in buyer section. |
400 | ERROR_VALUE_MISSING / MISSING_BUYER_EXT_CUSTOMER_ID | Validation error, extCustomerId field missing in buyer section. |
400 | ERROR_VALUE_MISSING / MISSING_AUTHORIZATION_CODE_OR_TOKEN | Validation error, authorization data is required - missing token. |
400 | ERROR_VALUE_INVALID / INVALID_ALIAS_LABEL_PROPOSAL_USAGE | aliasLabelProposal field cannot be used during token payment. |
400 | ERROR_VALUE_INVALID / AMBIGUOUS_AUTHORIZATION_USAGE | Two authorization methods have been specified; for token payment, only the value field, where the token will be placed, should be filled. |
400 | BUSINESS_ERROR / RECOMMENDED_AUTH_LEVEL_NOT_ALLOWED | The option to select the authorization level has not been made available to the merchant. Contact our customer service. |
400 | BUSINESS_ERROR / RECOMMENDED_AUTH_LEVEL_USAGE_NOT_ALLOWED | Using recommendedAuthLevel requires signing an appropriate annex and meeting certain compliance requirements. |