The reference is your key to a comprehensive understanding of the Checkout API.
Before interact with APIs merchant should be authenticated. Each Idempotent APIs requires X-Idempotency-Key on the request header.
Samples requests and responses are shown for each endpoint. Requests are in cURL format. In order to work with APIs, X-Idempotency-Key should be provided. Below idempotent required APIs are defined. Each POST API is retryable. With same idempotency key those APIs can be retried in case of 5xx errors.
| ID | Endpoint | Case | Pre-conditions | Steps | Expected |
|---|---|---|---|---|---|
| P1.1 | POST /v1/payments | create payment | 1. Merchant should be authenticated. 2. Merchant should obtain terminalId and merchantId for payments. | 1. send create payment request with confirmation type REDIRECT to see checkout page. 2. redirect to confirmation url. 3. check payment methods availability. 4. complete payment with relevant flows (see integration scenarios). | 1. payment response with status pending, confirmation url and etc. |
| P1.2 | POST /v1/payments/{id} | check payment status | 1. Merchant should be authenticated. 2. Payment ID should be available. | 1. send check payment | 1. payment response with details |
| P1.3 | POST /v1/refunds | create refund | 1. Merchant should be authenticated. 2. Original ID should be available. 3. Refund amount should be available. 4. Merchant balance should be sufficient to make payment. 5. Amount should not be greater than original amount. | 1. send create refund request | 1. refund response with status succeeded or canceled. |
| P1.4 | POST /v1/refunds/{id} | check refund status | 1. Merchant should be authenticated. 2. Refund ID should be available. | 1. send check refund | 1. refund response with details |
merchantId — E1040009, terminalId — E1040009
Card: 4169738886501026 - 369 - 1025
Use the following base URLs depending on your environment:
| Environment | URL |
|---|---|
| Preprod | https://preapi.birpay.az |
| Production | https://api.birpay.az |