Check your key, balance and quota
/api/v1/mewallet:readMake this your first request after receiving a key, to confirm the key really works. It also answers the four things the rest of these docs assume you already know: what this key is allowed to do (scopes) · how much money your wallet holds and in which currency (wallet) · what discount you actually get, per product type (discount) · how many requests you have left today (quota). ⚠️ There is no sign-up, no test key and no sandbox: keys are issued by the shop's admin only, every request from here on runs against the live system, and every order spends real money.
The refusals at the authentication gate — they can happen on any endpoint
These five are thrown before the request ever reaches the logic of any endpoint: invalid_key (401) no authentication header, malformed key, unknown key, or the wrong secret · key_revoked (401) this key has been revoked · insufficient_scope (403) the key works but lacks the scope that endpoint requires · quota_exceeded (429) the daily quota is spent · too_many_inflight (429) this key has more requests open at once than its ceiling allows. None of these five spends any of your daily quota, both 429s included, because the refusal happens before the counter is ever touched. The 401 and 403 group comes back with **no X-RateLimit-* header at all — the counter was never read, so there is nothing to report — while both 429s carry the full set plus Retry-After, and all five carry Cache-Control: private, no-store. The two 429s share a status but need opposite handling, so branch on data.code, never on the HTTP status alone:** quota_exceeded really is spent until the reset, while too_many_inflight clears itself within seconds — code that treats every 429 the same will sleep for hours over a collision that resolves in two.
Decide from statusCode and data.code only
Every endpoint reports failure in the same envelope: error is always true and only present on failure · url is the full URL of the request that failed · statusCode repeats the HTTP status inside the body · statusMessage is the literal string Server Error every time, even on a 400 or a 401, because it is a framework default that no endpoint here ever sets; it carries no meaning at all, so do not read it. The HTTP status line itself is that same default — you will see 401 Server Error, not 401 Unauthorized — so do not read that either; read the number. message is a sentence for humans and its wording can change at any time, so never match on it. data.code is our own code, from a limited set, and it is the value these docs pin down. New values of data.code can be added at any time, so always keep a fallback branch for one you do not recognise rather than branching without a default. Orders are the one exception: an order that was created successfully and failed afterwards reports that failure in a field on the order itself, while the HTTP status stays 200.
The wallet balance and the catalogue price are not always the same unit
Every price the API quotes — for a product, for a market listing, for an order — is always in Thai baht, with no currency field beside it, because it can never be anything else. The two other amounts always carry their own currency, and you must read it from the neighbouring field rather than assume baht: wallet.balance here is held in the currency named by wallet.currency, and the amount actually taken for an order (the charged field) is in the wallet's currency at the moment it was taken. Subtracting a catalogue price from a wallet balance to decide whether there is enough money is therefore a unit error the moment the wallet is not in baht.
Request parameters
Header
| Name | Type | How to use it |
|---|---|---|
| AuthorizationRequired | string | Your key as Bearer <key>, required on every request to every endpoint, and **issued by the shop's admin onlyDetails and caveats
|
Response fields
| Name | Type | How to use it |
|---|---|---|
| uid | string | The id of the shop account this key is attached to · Purchases are charged to this account's wallet, and every order placed with this key belongs to this account |
| scopes | array of strings | The permissions (scopes) this key holds, of which there are four in the whole system: catalog:read reads the catalogue and the pre-owned account listingsDetails and caveats
|
| wallet.balance | number or null | The wallet balance, where null means we could not read it and does not mean zeroDetails and caveats
|
| wallet.currency | string | The currency of that balance; THB when the account has no currency stored |
| discount.tier_percent | number | Your account's discount tier, in percent Details and caveats
|
| discount.effective_percent | object | The discount you actually get per product type, in percent, with that type's cap already applied, keyed by product type Details and caveats
|
| quota.limit | number | Today's quota for this key: 2,000 requests per day by default, counted afresh at midnight Thai time (UTC+7), and adjustable per key Details and caveats
|
| quota.remaining | number | How many requests you have left today, with this one already counted Details and caveats
|
| quota.resets_at | ISO 8601 string (UTC) | When the counter resets — the same moment as X-RateLimit-Reset, written as a date instead of a Unix timestamp |
Possible statuses
| Status | Code | Meaning |
|---|---|---|
| 200 | — | The key works — here are its details Every field this endpoint returns is in the example Details and caveats
|
| 401 | invalid_key | The key cannot be used — retrying will not help Check that the header is there and that the key is the right one, because retrying can never succeed Details and caveats
|
| 401 | key_revoked | The key has been revoked — ask for a new one Ask the shop for a new key; no number of retries will get through Details and caveats
|
| 403 | insufficient_scope | The key works, but lacks the scope this endpoint needs The key itself is fine; it simply does not hold the permission this endpoint requires Details and caveats
|
| 429 | quota_exceeded | Today's quota is spent — wait for the reset Read Retry-After and wait exactly that longDetails and caveats
|
| 429 | too_many_inflight | Too many requests at once — retry in a few seconds This key currently has more requests open at the same time than its ceiling allows (5 concurrent requests by default, adjustable per key) Details and caveats
|