orders.quote
POST/orders/quote
Quotes one item with a discount code for the key's account without creating an order: list price, discount and amount to pay. Needs a key from an account with a verified email.
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 | Required. Discount code to check, up to 32 characters. |
Request
curl -X POST "https://api.modernengineer.dev/orders/quote" \
-H "Authorization: Bearer $SE_KEY" \
-H "Content-Type: application/json" \
-d '{"sku":"plan-3m","discountCode":"WELCOME10"}'Response
{
"sku": "plan-3m",
"listAmountVnd": 269000,
"amountVnd": 242100,
"discountVnd": 26900,
"discountCode": "WELCOME10"
}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 30 quotes in an hour for this account. |