Skip to main content

3.1 Create payin

Create payin

POST /api/v1/payins

Creates a single payin on behalf of the merchant.

Shop routing: optionally specify shop_code in the request body. If shop_code is not provided, the operation is created in the merchant's default shop.

Headers

ParameterTypeRequiredDescription
X-API-KeystringYesAPI key.
X-TimestampstringYesRequest time (ISO-8601 or UNIX sec).
X-SignaturestringYesHMAC-SHA256(timestamp + body, secret).
Content-TypestringYesapplication/json.

Request body (JSON)

ParameterTypeRequiredDescription
external_idstringYesUnique payin identifier on the merchant side (idempotency).
amountnumberYesPayin amount (must be greater than 0).
currencystring (3)YesISO currency code (RUB, USD, etc.).
shop_codestringNoShop code. If not provided — default shop is used.
callback_urlstringNoURL for status change notifications (must be a valid URL).
merchant_user_idstringNoMerchant user identifier (for accounting).
merchant_user_ipstringNoUser IP (for accounting).
paymentDataobjectNoAdditional data according to the shop's payin schema.

Additional fields may be included in paymentData according to the shop configuration. The API also accepts the alias payment_data for compatibility.

paymentData fields by direction (shop):

Example request

{
"external_id": "PIN-001",
"amount": 1000.00,
"currency": "BDT",
"shop_code": "shop-001",
"callback_url": "https://merchant.example.com/webhooks/payin",
"paymentData": {
...
}
}

Response 201 (Created)

A single created operation object is returned (not an array).

{
"id": 12345,
"status": "pending",
"external_id": "PIN-001",
"amount": 1000,
"currency": "BDT",
"shop_code": "shop-001",
"merchant_user_id": null,
"merchant_user_ip": null,
"callback_url": "https://merchant.example.com/webhooks/payin",
"paymentData": {
...
},
"transaction_type": "payin",
"created_at": "2025-12-05T10:00:00.000000Z",
"updated_at": "2025-12-05T10:00:00.000000Z",
"finalization_date": null
}

For payment-page flows, the response may also include payment_page_url and payment_page_expires_at.

When the same request is sent again with the same external_id and shop (idempotency), the API returns 200 and the existing operation object with "message": "Transaction already exists" (no new payin is created).

The same external_id may still be used for a payout in the same shop. Idempotency is scoped by transaction type and shop.

Errors

  • 422 — validation error: missing or invalid external_id, amount, currency; invalid callback_url; invalid paymentData; limit exceeded; shop currency mismatch.