simpay-api (1.0.0)
https://docs.simpay.pl/_mock/en/apis/
https://api.simpay.pl/
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling
https://api.simpay.pl/directbilling
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.simpay.pl/_mock/en/apis/directbilling \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{ "success": true, "data": [ { … } ], "pagination": { "total": 1, "count": 1, "per_page": 15, "current_page": 1, "total_pages": 1, "links": { … } } }
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}
https://api.simpay.pl/directbilling/{serviceId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{ "success": true, "data": { "id": "d151e4f9", "name": "Test service", "suffix": "Test1", "status": "service_active", "created_at": "2021-11-08T18:19:16+01:00" } }
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/calculate
https://api.simpay.pl/directbilling/{serviceId}/calculate
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/calculate?amount=0.1' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
{ "success": true, "data": { "orange": { … }, "play": { … }, "t-mobile": null, "plus": null } }
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions
https://api.simpay.pl/directbilling/{serviceId}/transactions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions?filter%5Bstatus%5D=transaction_db_new&filter%5BphoneNumber%5D=48123123123&filter%5Bcontrol%5D=string' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Transaction status
{ "success": true, "data": [ { … } ], "pagination": { "total": 1, "count": 1, "per_page": 15, "current_page": 1, "total_pages": 1, "links": { … } } }
Transaction amount type
required
- a fixed amount that the partner wants to obtain, the final amount to be paid will be visible on the gateway and depends on the operatornet
- net amountgross
- gross amount
Transaction description visible on the payment gateway
Parameter for use by the partner for, e.g. transaction identification
URLs to redirect the customer after the transaction
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions
https://api.simpay.pl/directbilling/{serviceId}/transactions
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"amount": 19.99,
"amountType": "gross",
"description": "Payment for virtual products",
"control": "96125f23-d549-4bfc-a845-b781b5f1ad03",
"returns": {
"success": "https://www.simpay.pl/success",
"failure": "https://www.simpay.pl/failure"
},
"phoneNumber": "48123123123"
}'
{ "success": true, "data": { "transactionId": "1d87a1b3-18f8-4146-bcb1-c0c9f293b04f", "redirectUrl": "https://db.simpay.pl/1d87a1b3-18f8-4146-bcb1-c0c9f293b04f" } }
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions/{transactionId}
https://api.simpay.pl/directbilling/{serviceId}/transactions/{transactionId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.simpay.pl/_mock/en/apis/directbilling/{serviceId}/transactions/{transactionId}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
Transaction ID
Transaction status
{ "success": true, "data": { "id": "dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a", "status": "transaction_db_payed", "phoneNumber": null, "control": "1d87a1b3-18f8-4146-bcb1-c0c9f293b04f", "value": 16.67, "value_netto": 10, "operator": "t-mobile", "notify": { … }, "created_at": "2023-02-16T14:52:11+01:00", "updated_at": "2023-02-16T14:52:11+01:00" } }
Request
Signature
Calculating the signature when receiving a notification
We generate the signature by combining all the parameters received (except for the signature) to the API in the order from the table above, separating them with a | separator and adding at the end the key available in the customer panel in the service.
Hashing must be done using sha256.
Example:
dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a|e14f8074|transaction_db_payed|11.07|13.67|5.00|https://www.simpay.pl/complete|https://www.simpay.pl/failure|test|123123123|1|key
The notification is sent using the POST
method and requires you to respond in the body with OK
and Http Code 200
Transaction ID
Transaction status
Transaction amounts
Signature of the notification Read how to generate the signature
- Mock server
https://docs.simpay.pl/_mock/en/apis/directbillingTransactionNotification
https://api.simpay.pl/directbillingTransactionNotification
{ "id": "dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a", "serviceId": "e14f8074", "status": "transaction_db_payed", "values": { "net": 11.07, "gross": 13.61, "partner": 5 }, "returns": { "complete": "https://www.simpay.pl/complete", "failure": "https://www.simpay.pl/failure" }, "number_from": "48123123123", "provider": 1, "signature": "a3116cf4f1e960223c2cc3088bf387278b6675255209bdeaf96a2f316a2fadc1" }
OK