POST /api/v1/p2p/orders
Create a P2P order against an existing advertisement. The seller's USDT is frozen for the duration of the order.
When a buyer creates an order against a sell ad, the ad owner's USDT is frozen. When a seller creates an order against a buy ad, the order creator's USDT is frozen.
Authentication
Required. Pass a Bearer token in the Authorization header.
Request
| Parameter | Type | In | Description |
|---|---|---|---|
ad_id | integer | body | ID of the advertisement to trade against |
usdt_amount | integer | body | Order amount in kopecks (balance units). For RUB this equals fiat amount |
payment_method | string | body | Selected payment method from the ad's payment_methods list |
payment_details | object | body | Payment details (optional; used when seller accepts a buy-ad order) |
format | string | body | Order format: "fast_pay" (card) or "p2p" (optional) |
Example
curl -X POST https://example.com/api/v1/p2p/orders \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"ad_id": 42,
"usdt_amount": 500000,
"payment_method": "sber"
}'
Response
200 OK
Returns the ID of the created order. If a card order was also created (bank P2P), card_order_id is included.
{
"id": 101,
"card_order_id": 55
}
The card_order_id field is only present when the order goes through the platform bank flow.
Errors
| Status | Code | Description |
|---|---|---|
| 400 | AD_NOT_ACTIVE | The referenced ad is not active |
| 400 | OWN_AD | Cannot create an order for your own ad |
| 400 | MIN_DEPOSIT_REQUIRED | Minimum total deposit required for withdrawal |
| 400 | WAGERING_REQUIREMENT_NOT_MET | Wagering requirement not met |
| 400 | AMOUNT_TOO_LOW | Amount is less than the ad minimum |
| 400 | AMOUNT_TOO_HIGH | Amount is greater than the ad maximum |
| 400 | AMOUNT_EXCEEDS_AVAILABLE | Amount exceeds available amount on this ad |
| 400 | AMOUNT_TOO_SMALL | Amount is too small for the given exchange rate |
| 400 | INVALID_PAYMENT_METHOD | Selected payment method is not accepted |
| 400 | SELLER_INSUFFICIENT_BALANCE | Seller has insufficient balance |
| 400 | ACTIVE_DEPOSIT_ORDER_EXISTS | Already have an active deposit order |
| 400 | ACTIVE_WITHDRAW_ORDER_EXISTS | Already have an active withdrawal order |
| 401 | — | Missing or invalid token |
| 500 | CREATE_ORDER_FAILED | Internal error |