Testing
You can test your BLIK integration in the Sandbox environment. This page lists test authorization codes that simulate various payment scenarios and provides sample requests.
The sample requests contain test data that you can change according to the integration description.
The following BLIK authorization codes simulate specific results:
- 200201 – positive authorization with token registration,
- 500500 – negative authorization,
- 777xxx – positive authorization without token registration,
- 700701 – the BLIK authorization code has expired,
- 700702 – the BLIK authorization code has been canceled,
- 700703 – the BLIK authorization code has already been used.
You can also simulate specific behavior for BLIK recurring payments:
payMethod.value = 401200during token registration – simulates an issuer that does not support BLIK recurring payments,totalAmount = 3930– simulates theAUT_ERROR_MIT_NOT_ALLOWEDerror,totalAmount = 3931– simulates theAUT_ERROR_LIMIT_EXCEEDEDerror,totalAmount = 3932– simulates theAUT_ERROR_INSUFFICIENT_FUNDSerror.
To receive these responses, your POS needs the Transparent payment with a BLIK authorization code or Transparent payment with the UID token configuration described on the BLIK page.
Before sending a test request, generate an OAuth token for your POS, using https://secure.snd.payu.com/pl/standard/user/oauth/authorize.
Payment with Redirection to the BLIK Payment Page
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"payMethods": {
"payMethod": {
"type": "PBL",
"value": "blik"
}
}
}'
Payment with a BLIK Authorization Code
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "777654"
}
}
}'
The response depends on the BLIK authorization code sent in the payMethods.payMethod.value field. Use any of the test codes listed above.
UID Token Payment
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"buyer": {
"extCustomerId": "customer123",
"email": "john.doe@email.com"
},
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "200201",
"blikData": {
"aliasLabelProposal": "token for eshop.pl",
"register": true
}
}
}
}'
The response depends on the BLIK authorization code sent in the payMethods.payMethod.value field. Use any of the test codes listed above.
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"buyer": {
"extCustomerId": "customer123",
"email": "john.doe@email.com"
},
"payMethods": {
"payMethod": {
"type": "BLIK_TOKEN",
"value": "SIMULATE_ALIAS_AMBIGUITY-5690871207003",
"blikData": {
"appKey": "22222662",
"recommendedAuthLevel": "NO_CONFIRMATION"
}
}
}
}'
For details about the parameters, see the Create an Order section in our API Reference.