Skip navigation
REST › orders.create

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

ParameterInDescription
skubodyRequired. Item to buy, taken from prices.list: plan-1m, plan-3m, plan-12m for a prepaid plan, or a retail guide's slug.
discountCodebodyOptional. Discount code, up to 32 characters. Each reader can use a code once.

Request

curl
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

200 OK · application/json
{
  "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

StatusErrorWhen
401unauthenticatedThe API key is missing or invalid. Comes with a WWW-Authenticate header.
403forbiddenThe account's email is not verified yet.
400invalid_inputA parameter is missing or invalid, for example a locale other than vi or en.
404not_foundNo item on sale has this sku.
409conflictYou already bought this retail guide.
422unprocessableThe discount code does not apply. details.reason says why: unknown, inactive, not_started, expired, wrong_item, already_used or exhausted.
429too_many_requestsMore than 20 orders in an hour for this account.
503service_unavailableBank-transfer checkout is closed for now.

In MCP