Integrating BLIK Payments
The interaction with PayU API will vary based on your selected integration method. Familiarize yourself with the order extensions required for different scenarios.
Payment processing for each integration type involves generating a standard order, supplemented with fields specific to the chosen integration approach.
Request Headers
When sending the request, make sure to include an Authorization
header containing the generated OAuth token for the request, and set the Content-Type
header to application/json:
-H Authorization: Bearer <token oauth for grant_type=client_credentials/trusted_merchant>
-H Content-Type: application/json
Redirecting to the BLIK Page
To authenticate the request, utilize an OAuth token in the grant_type=client_credentials
mode, and include it in the request header.
Order Extensions
Because the redirection of the buyer to the BLIK payment page follows the pattern of a pay-by-link payment, you should incorporate a payMethods
section within the standard order. In this section, set the type
parameter as PBL and the value
parameter as 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
To authenticate the request, utilize an OAuth token in grant_type=client_credentials
mode, and include it in the request header.
Order Extensions
Incorporate a payMethods
segment within the standard order, setting the type
parameter set to BLIK_AUTHORIZATION_CODE and the value
parameter to the value of the BLIK authorization code generated by the buyer.
You must also include the countryCode
field with the value set to SK if the payment is initiated on the Slovak market. You can omit this parameter if payment is initiated on Polish market.
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "<BLIK authorization code>",
"blikData": {
"countryCode": "SK"
}
}
}
For details on parameters, refer to the payMethod
object detailed in 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 | Status Code | 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
To authenticate the request, utilize an OAuth token in grant_type=trusted_merchant
mode, and include it in the request header.
One BLIK token can be associated with 5 different bank mobile applications.
Order Extensions
Extend the standard order by adding a buyer
section containing extCustomerId
section. Additionally, include a payMethods
section featuring a blikData
object with a register
parameter set to true.
You must also include the countryCode
field with the value set to SK if the payment is initiated on the Slovak market. You can omit this parameter if payment is initiated on 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 on parameters, refer to the payMethod
object detailed in 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 | Status Code / Code Literal | Description |
---|---|---|
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 beed saved by the customer. |
BLIK Payment with UID Token
To authenticate the request, utilize an OAuth token in grant_type=trusted_merchant
mode and include it in the request header.
Order Extension
Extend the standard order by adding a buyer
section containing extCustomerId
section. Additionally, include a payMethods
section featuring a blikData
object with the identifier of the selected banking application and the recommended authorization level.
You must also include the countryCode
field with the value set to SK if the payment is initiated on the Slovak market. You can omit this parameter if payment is initiated on 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 on parameters, refer to the payMethod
object detailed in 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 | Status Code / Code Literal | 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 currencies: PLN. |
400 | ERROR_VALUE_MISSING / MISSING_APPKEY | Validation error, bank's mobile application identifer 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. Please contact our customer service. |