1. MinGlobal External API (v1)
MIN-Global API
  • MinGlobal External API (v1)
    • 01. Overview and Quick Start
      • Step 1. Check API Reachability (no key needed)
      • Step 2. Your First Signed Request
    • 02. Authentication and Request Signing
    • 03. Spot Trading Explained
    • 04. Futures Trading Explained
    • 05. Data Formats and Conventions
    • 06. Errors and Troubleshooting
    • 07. Rate Limits, Permissions and Known Limits
    • 08. Market Data API (public, no key needed)
      • List Spot Trading Pairs
      • Get All Spot Tickers
      • Get Spot Candlesticks (Klines)
      • Get Spot Order Book (Depth)
      • Get Recent Spot Trades
      • List Futures Contracts
      • Get All Futures Tickers
      • Get Futures Candlesticks (Klines)
      • Get Futures Order Book (Depth)
      • Get Recent Futures Trades
    • 09. Wallets and Balances API
      • Get All Balances
      • Get Balances by Coin
    • 10. Assets and Networks API
      • List Supported Coins
      • List Networks for a Coin
    • 11. Spot Trading API
      • Place Spot Order (Limit Buy)
      • Place Spot Order (Market Sell)
      • List Your Spot Orders
      • Get One Spot Order
      • Cancel Spot Order
    • 12. Futures Trading API
      • Get Futures Margin Balance
      • Open Futures Position (Limit Long)
      • Close Futures Position (Reduce Only)
      • List Open Futures Orders
      • Get Futures Order History
      • Get One Futures Order
      • Cancel Futures Order
  1. MinGlobal External API (v1)

06. Errors and Troubleshooting

Errors and Troubleshooting#

The error envelope#

Every error, from every endpoint, has this shape:
{
  "error": {
    "code": "MACHINE_READABLE_CODE",
    "message": "Human readable explanation"
  }
}
Branch your code on error.code, never on error.message. Messages are written for people and can be reworded.
Two codes add a field. VALIDATION_ERROR adds details, telling you exactly which field failed:
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid request",
  "details": [{ "path": "quantity", "message": "Required" }] } }
INTERNAL adds a requestId. Quote it when you contact support:
{ "error": { "code": "INTERNAL", "message": "Internal server error",
  "requestId": "01J9X2K7Qv..." } }

Authentication errors#

StatuscodeWhat it meansWhat to do
401INVALID_API_KEYNo key matches X-MG-API-KEYCheck the header value for typos and stray whitespace
401INVALID_SIGNATUREThe digest did not match, or the header is missingWork through the checklist below
401INVALID_TIMESTAMPOutside the receive window, unreadable, missing, or a window above 60000 msSync your clock. Use milliseconds
401REPLAYED_REQUESTThis exact signature was already used inside its windowRe-sign with a fresh timestamp. Never resend identical signed bytes
403INVALID_ORIGINYour Origin or Referer does not match the key's domain, or you sent neitherSend Origin: <your registered domain> on every request
403API_PERMISSION_DENIEDThe key lacks this route's permissionSee the permissions table in section 07
403API_KEY_DISABLEDAn administrator disabled the keyContact support. Only an administrator can restore it
403KYC_REQUIREDThe account has not completed identity verificationFinish verification in the web app, then retry. No code change is needed
429RATE_LIMIT_EXCEEDEDYou passed the per-key rate limitBack off. See section 07

Transport and validation errors#

StatuscodeWhat it means
400MALFORMED_JSONThe body is not valid JSON
400VALIDATION_ERRORThe body or query failed schema validation. Read details
404NOT_FOUNDUnknown route, or a resource that is not yours
409CONFLICTDuplicate resource
409IDEMPOTENCY_IN_PROGRESSThe original request with this Idempotency-Key is still running
413PAYLOAD_TOO_LARGEThe body is over 32 KB
429RATE_LIMITEDThe global per-IP limit, which is separate from RATE_LIMIT_EXCEEDED
500INTERNALA server fault. Quote requestId to support

Trading errors#

StatuscodeWhereWhat it means
409INSUFFICIENT_BALANCESpotNot enough spendable balance to reserve. Nothing was written
409INSUFFICIENT_MARGINFuturesNot enough in the futures wallet
409MARGIN_MODE_CONFLICTFuturesAn open position on this symbol already uses the other margin mode
429TOO_MANY_OPEN_ORDERSSpot200 orders are already open on this symbol. Retrying will not help. Cancel one
400ORDER_ALREADY_TERMINALCancelThe order already finished and cannot be cancelled
501CANCEL_NOT_SUPPORTEDSpot cancelThis market runs on the internal matching engine, which has no cancel endpoint. The order stays open and may still fill
409CANCEL_REJECTED_BY_VENUESpot cancelThe exchange answered and refused. details.venueCode carries its own code. Retrying will fail identically
503VENUE_UNAVAILABLESpot cancelWe could not get a usable answer from the exchange. Whether the cancel landed is genuinely unknown. Retryable after a short back-off

Instrument limit messages#

These all arrive as 400 VALIDATION_ERROR, and the message often suggests a corrected value:
{ "error": { "code": "VALIDATION_ERROR",
  "message": "price must be a multiple of tickSize (0.01), try 60000.00" } }
Others in the same family: quantity must be a multiple of stepSize (...), quantity (...) is below the minimum (...), order notional (...) is below the minimum (...), BTC-USDT is not currently tradeable, and no live price available for BTC-USDT, try again shortly.

Debugging 401 INVALID_SIGNATURE#

The error deliberately does not distinguish "wrong secret" from "wrong canonical payload", because that would turn it into a way of testing secrets. Work through this list in order. In practice it is nearly always number 1 or number 2.
First make sure it really is this error. 403 INVALID_ORIGIN is a different failure that is checked earlier, and nothing on this list will fix it.
1.
Body hash. Are you hashing the exact bytes you transmit? Log both and compare them character by character.
2.
Content-Type: application/json present on every request that has a body?
3.
Query string signed raw and unsorted, without the ?, and identical to what you send?
4.
Request path only, with no host, no query string, and no trailing slash you did not actually send?
5.
Newline separator is a real \n (0x0A), not \r\n, and there is no trailing newline at the end?
6.
Receive window field is the empty string if you omitted the header, not 5000?
7.
Method in uppercase?
8.
Secret copied in full, including the mgs_ prefix, with no whitespace?
Then check your implementation against the three verified test vectors in 02. Authentication and Request Signing. If your code reproduces all three, your signing is correct and the problem is elsewhere.

Debugging 403 INVALID_ORIGIN#

Checked before the signature, so this fails identically whether your signing is right or wrong. Rule it out first when a working client suddenly stops.
Are you sending an Origin header at all? No server-side HTTP library adds one for you.
Does it match exactly, scheme included? http:// is not https://.
Is it the registered domain, not a subdomain? https://api.x.example is not https://x.example.
No path, no query, no trailing slash. Just scheme://host.
There are no wildcards.

Debugging 409 INSUFFICIENT_BALANCE when you can see the money#

Almost always one of these three:
1.
The funds are in a different wallet. Spot orders spend from the spot wallet. Check wallets.<COIN>.spot.available, not the total.
2.
The funds are locked by other open orders. locked is not spendable.
3.
You are looking at pending deposits. Those are detected on-chain but not yet credited, and they are not part of available.
Modified at 2026-09-02 09:50:41
Previous
05. Data Formats and Conventions
Next
07. Rate Limits, Permissions and Known Limits
Built with