https://<host>
URI prefix — /v1/...
x-api-key header on every server-to-server requestwebhookUrl in real timePOST /v1/payments/create require two layers of verification: an API key in the request header and your server's IP address in the whitelist.API Key
Include your API key in the x-api-key header on every request.
POST /v1/payments/create x-api-key: YOUR_API_KEY Content-Type: application/json
| Header | Value |
|---|---|
x-api-key | API key issued to you upon merchant registration. |
IP Whitelist
Requests are additionally verified against the IP whitelist for your merchant account. Requests from unknown addresses are rejected regardless of API key validity.
paymentReference more than once will not create duplicate invoices or charges.If a request with a given paymentReference has already been processed, BRICS Pay returns the original response — including the same invoicePageUrl — without creating a new invoice.
| Scenario | Behaviour |
|---|---|
First request with a paymentReference |
Invoice is created. Returns invoicePageUrl. |
Repeated request with the same paymentReference |
No new invoice is created. Returns the original invoicePageUrl. |
Request with a different paymentReference |
A new, independent invoice is created. |
paymentReference. This makes retries after network failures safe without any additional coordination.
| Field | Type | Description |
|---|---|---|
| paymentReferencerequired | string | Your unique order identifier. Resubmitting the same value returns the existing invoice without creating a new one. See Idempotency. |
| methodrequired | string | Payment method: "CARD" or "SBP". |
| currencyTickerrequired | string | Must be "RUB". |
| returnUrloptional | string | Fallback redirect URL for any outcome when successUrl / failUrl are not set. |
| successUrloptional | string | Redirect URL after a successful payment. Overrides returnUrl on success. |
| failUrloptional | string | Redirect URL after a failed payment. Overrides returnUrl on failure. |
| client.billing.countryCoderequired | string | Payer's country code, ISO 3166-1 alpha-2. Example: "RU". |
| client.billing.emailoptional | string | Payer's email address. |
| client.billing.phoneoptional | string | Payer's phone number. |
| client.billing.firstNameoptional | string | Payer's first name. |
| client.billing.lastNameoptional | string | Payer's last name. |
| productsrequired | array | Line items. At least one item required. Total charge = sum(unitPrice × quantity). |
| products[].namerequired | string | Product or service name. |
| products[].skurequired | string | Product article / SKU in your system. |
| products[].unitPricerequired | number | Price per unit in RUB. |
| products[].quantityrequired | number | Number of units. |
On success, returns a single URL to redirect your customer to. The invoice stays active until its configured time-to-live expires.
{
"invoicePageUrl": "https://<host>/invoice/a1b2c3d4-e5f6-..."
}invoicePageUrl immediately. Once the invoice expires its status changes to EXPIRED and payment can no longer be completed.
{
"paymentReference": "order-12345",
"method": "CARD",
"currencyTicker": "RUB",
"returnUrl": "https://your-shop.com/return",
"successUrl": "https://your-shop.com/success",
"failUrl": "https://your-shop.com/fail",
"client": {
"billing": {
"countryCode": "RU",
"email": "[email protected]",
"phone": "+79001234567",
"firstName": "Ivan",
"lastName": "Ivanov"
}
},
"products": [
{
"name": "Pro Subscription",
"sku": "sub-pro-1m",
"unitPrice": 999.00,
"quantity": 1
}
]
}invoicePageUrl and BRICS Pay handles the rest — no additional integration required.Returns an HTML page for display in the customer's browser. Routing happens automatically when the customer follows invoicePageUrl.
The page adapts to the chosen payment method:
- For
CARD— a secure card entry form - For
SBP— a button to open the customer's banking app
Page states by payment status
POST request to the webhookUrl configured for your merchant account whenever a payment status changes.2xx response. If it does not, the webhook status is set to ERROR. To trigger a retry, contact your administrator — automatic retries are not currently supported.
webhookData.reference to match the event to your internal order.{
"webhookId": "550e8400-e29b-41d4-a716-446655440000",
"webhookType": "INVOICE_STATUS_UPDATE",
"webhookData": {
"reference": "order-12345", // your paymentReference
"status": "COMPLETED"
}
}Payload fields
| Field | Type | Description |
|---|---|---|
| webhookId | string (UUID) | Unique identifier for this webhook delivery. Use for deduplication. |
| webhookType | string | Always "INVOICE_STATUS_UPDATE". |
| webhookData.reference | string | Your paymentReference as supplied when creating the invoice. |
| webhookData.status | string | New payment status. See Payment Statuses. |
webhookId as a deduplication key — store it and ignore any delivery that carries a webhookId you have already processed.
| Field | Type | Description |
|---|---|---|
| reference | string | Your unique order identifier, as provided in paymentReference at invoice creation. |
| status | string | Current payment status. See Payment Statuses. |
| method | string | Payment method: "CARD" or "SBP". |
| currencyTicker | string | Always "RUB". |
| amount | number | Total charge in RUB. Calculated as sum(products[].unitPrice × quantity). |
| products | array | Line items as provided at invoice creation. Each item contains name, sku, unitPrice, and quantity. |
| client | object | Payer information as provided at invoice creation: billing.countryCode, billing.email, billing.phone, billing.firstName, billing.lastName. |
| invoicePageUrl | string | The hosted payment page URL. Valid until the invoice expires. |
| successUrl | string · null | Redirect URL on successful payment, as provided at creation. |
| failUrl | string · null | Redirect URL on failed payment, as provided at creation. |
| returnUrl | string · null | Fallback redirect URL, as provided at creation. |
COMPLETED means funds were successfully collected.INITIATED → AUTHORIZATION_FAILED
INITIATED → EXPIRED
COMPLETED → REFUNDED
POST /v1/payments/create with order details. BRICS Pay returns invoicePageUrl.invoicePageUrl. BRICS Pay serves the hosted payment page.INVOICE_STATUS_UPDATE event to your webhookUrl with the new payment status.webhookData.status === "COMPLETED" and fulfil the order. Respond 2xx to acknowledge the webhook.| Field | Type | Description |
|---|---|---|
| originalPaymentReferencerequired | string | Your paymentReference of the original payment to be refunded. The payment must be in status COMPLETED or PARTIALLY_REFUNDED. |
| refundReferencerequired | string | Your unique identifier for this refund request. Must be globally unique — submitting the same value twice is rejected. |
| amountrequired | number | Amount to refund in the payment's currency (RUB). Must not exceed the remaining refundable balance: original amount − sum of non-failed refunds. |
refundReference must be unique. Reusing an existing reference returns an error even if the original refund failed.
Returns immediately with status INITIATED. The final outcome (COMPLETED or FAILED) arrives via webhook.
{
"refundReference": "ref_456"
}Error cases
{
"originalPaymentReference": "pay_123",
"refundReference": "ref_456",
"amount": 500.00
}{
"refundReference": "ref_456"
}Path parameter :reference is your refundReference as provided when creating the refund.
{
"refundReference": "ref_456",
"status": "INITIATED"
}| Field | Type | Description |
|---|---|---|
| refundReference | string | Your refund identifier, as provided at creation. |
| status | string | Current refund status: INITIATED, COMPLETED, or FAILED. See Refund Statuses. |
REFUND_STATUS_UPDATE event to the webhookUrl configured for your merchant account.2xx response. If it does not, the webhook status is set to ERROR. Automatic retries are not currently supported — contact your administrator to trigger a manual retry.
COMPLETED or FAILED. Use webhookData.reference to match the event to your refund record.{
"webhookId": "550e8400-e29b-41d4-a716-446655440001",
"webhookType": "REFUND_STATUS_UPDATE",
"webhookData": {
"reference": "ref_456", // your refundReference
"status": "COMPLETED"
}
}Payload fields
| Field | Type | Description |
|---|---|---|
| webhookId | string (UUID) | Unique identifier for this webhook delivery. Use for deduplication. |
| webhookType | string | Always "REFUND_STATUS_UPDATE". |
| webhookData.reference | string | Your refundReference as supplied when creating the refund. |
| webhookData.status | string | Terminal refund status: COMPLETED or FAILED. |
POST /webhooks/invoice-status) and are distinguished by the presence of refundRequestId in the provider payload. Use webhookId as a deduplication key.
INITIATED. The terminal status arrives asynchronously via webhook once the provider has processed the request.Refund status lifecycle
INITIATED → FAILED
Effect on payment status
A successful refund updates the originating payment's status based on the remaining refundable balance.
COMPLETED → REFUNDED (full refund in one request)
POST /v1/refunds/create with originalPaymentReference, a unique refundReference, and the amount. BRICS Pay validates eligibility and immediately responds with {"refundReference": "..."}.INITIATED and calls the provider's POST /api/v4/payments/refund. The provider returns a refundRequestId used to correlate the webhook.POST /webhooks/invoice-status. BRICS Pay identifies it as a refund event via refundRequestId and transitions the refund to COMPLETED or FAILED. The originating payment status is updated accordingly.REFUND_STATUS_UPDATE event to your webhookUrl. Verify webhookData.status === "COMPLETED" and update your order accordingly. Respond 2xx to acknowledge.FAILED refund does not block you from initiating another refund for the same payment — as long as the payment is still in an eligible status and a new unique refundReference is used.