orders.create
POST/orders
Creates a bank-transfer (VietQR) order for the key's account. Transfer exactly amountVnd with the order code as the transfer note; access is granted when SePay reports the transfer. Unpaid orders expire after 24 hours. Asking again with the same sku and discountCode while that order is pending returns it instead of a new one. A discount that brings the amount to 0 returns the order already paid.
Parameters
| Parameter | In | Description |
|---|---|---|
sku | body | Required. Item to buy, taken from prices.list: plan-1m, plan-3m, plan-12m for a prepaid plan, or a retail guide's slug. |
discountCode | body | Optional. Discount code, up to 32 characters. Each reader can use a code once. |
Request
curl -X POST "https://api.modernengineer.dev/orders" \
-H "Authorization: Bearer $SE_KEY" \
-H "Content-Type: application/json" \
-d '{"sku":"plan-3m","discountCode":"WELCOME10"}'Response
{
"code": "ME48213906",
"sku": "plan-3m",
"kind": "subscription",
"label": "3 tháng",
"amountVnd": 242100,
"listAmountVnd": 269000,
"discountVnd": 26900,
"discountCode": "WELCOME10",
"periodMonths": 3,
"packSlug": null,
"status": "pending",
"expiresAt": "2026-11-02T03:15:00.000Z",
"paidAt": null,
"createdAt": "2026-11-01T03:15:00.000Z",
"payment": {
"accountName": "…",
"accountNumber": "…",
"bankCode": "…",
"qrUrl": "https://qr.sepay.vn/img?acc=…&bank=…&amount=242100&des=ME48213906"
},
"testMode": false
}Errors
| Status | Error | When |
|---|---|---|
| 401 | unauthenticated | The API key is missing or invalid. Comes with a WWW-Authenticate header. |
| 403 | forbidden | The account's email is not verified yet. |
| 400 | invalid_input | A parameter is missing or invalid, for example a locale other than vi or en. |
| 404 | not_found | No item on sale has this sku. |
| 409 | conflict | You already bought this retail guide. |
| 422 | unprocessable | The discount code does not apply. details.reason says why: unknown, inactive, not_started, expired, wrong_item, already_used or exhausted. |
| 429 | too_many_requests | More than 20 orders in an hour for this account. |
| 503 | service_unavailable | Bank-transfer checkout is closed for now. |