/orders/create
Create Order
Place a new order. You must provide a unique UUID as the order_id for idempotency. The wallet will be charged immediately.
محدودیت نرخ120 req / 60s per user
نکته: The order_id is your idempotency key. If you retry with the same UUID, the existing order is returned instead of creating a duplicate.
بدنه درخواست
| نام | نوع | الزامی | توضیح | نمونه |
|---|---|---|---|---|
| order_id | string (UUID) | بله | A unique UUID for this order (any format: v1, v4, v7, etc.). Used as an idempotency key. | 01912345-6789-7abc-8def-0123456789ab |
| sub_category_id | number | بله | The product subcategory ID. | 999 |
| quantity | number | بله | Number of units to order (positive integer). | 1 |
| requirements | object | بله | Player delivery info. Include all fields returned by the Get Category Requirements endpoint. | {"player_id": "123456789", "server": "Asia"} |
| expected_unit_price | string | خیر | Price protection. If current price exceeds this value, the order is rejected. | 0.950000 |
curl -s -X POST "https://shop2topup.com/api/endpoints/v1/orders/create" \
-H "Authorization: Bearer YOUR_KEY_ID.YOUR_KEY_SECRET" \
-H "Content-Type: application/json" \
-d '{
"order_id": "01912345-6789-7abc-8def-0123456789ab",
"sub_category_id": 999,
"quantity": 1,
"requirements": {
"player_id": "123456789",
"server": "Asia"
},
"expected_unit_price": 0.95
}'{
"success": true,
"order": {
"order_id": "01912345-6789-7abc-8def-0123456789ab",
"status": "pending",
"player_id": "123456789",
"player_name": "ProGamer99",
"subcategory_name": "FF 100 Diamonds",
"quantity": 1,
"charged_amount": "0.950000",
"currency": "USD",
"created_at": "2024-06-15T12:00:00Z"
}
}