{
"object": "order",
"id": "<string>",
"state": "sending",
"account": "<string>",
"symbol": "<string>",
"side": "buy",
"quantity": 123,
"type": "limit",
"time_in_force": "day",
"price_kobo": 123,
"filled_quantity": 123,
"exchange_order_id": "<string>",
"reason": "<string>",
"reject_reason": "insufficient_funds",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"object": "order",
"id": "<string>",
"state": "sending",
"account": "<string>",
"symbol": "<string>",
"side": "buy",
"quantity": 123,
"type": "limit",
"time_in_force": "day",
"price_kobo": 123,
"filled_quantity": 123,
"exchange_order_id": "<string>",
"reason": "<string>",
"reject_reason": "insufficient_funds",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}Place an order
Stores the order, then sends it to the exchange once. If an order ends in uncertain, we don’t send it again. Retrieve it, or wait for its event, until it resolves.
{
"object": "order",
"id": "<string>",
"state": "sending",
"account": "<string>",
"symbol": "<string>",
"side": "buy",
"quantity": 123,
"type": "limit",
"time_in_force": "day",
"price_kobo": 123,
"filled_quantity": 123,
"exchange_order_id": "<string>",
"reason": "<string>",
"reject_reason": "insufficient_funds",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"object": "order",
"id": "<string>",
"state": "sending",
"account": "<string>",
"symbol": "<string>",
"side": "buy",
"quantity": 123,
"type": "limit",
"time_in_force": "day",
"price_kobo": 123,
"filled_quantity": 123,
"exchange_order_id": "<string>",
"reason": "<string>",
"reject_reason": "insufficient_funds",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}{
"error": {
"type": "authentication_error",
"code": "unauthorized",
"message": "<string>",
"doc_url": "<string>",
"param": "<string>",
"reject_reason": "<string>"
}
}Authorizations
Authorization: Bearer <key>. Sandbox keys start with mgw_test_ and live keys start with mgw_live_. Each key works only in its own environment, and a live key works only from the IP addresses or ranges registered for it.
Headers
A key you choose to identify this request. Send the same key every time you retry the request. Once used, a key stays tied to that request permanently. It must be printable ASCII with no spaces, and we compare it byte for byte. Send the header only once.
1 - 255^[!-~]+$Body
Send numbers as JSON numbers, not quoted strings. We reject unknown fields and any field that appears twice, even with different letter case.
An account code. Case-insensitive on input, and returned in uppercase.
^[A-Za-z0-9]{1,64}$The exchange's symbol, treated as uppercase. The exchange decides whether the symbol exists.
^[A-Za-z0-9.-]{1,20}$buy, sell The number of shares, as a whole number.
1 <= x <= 100000000limit, market day, gtc, ioc, fok The limit price in kobo, so ₦475.00 is 47500. Required for a limit order. Omit it for a market order.
1 <= x <= 1000000000Response
This idempotency key was already used for this same order, so we didn't send anything new. The body shows the order's current state.
"order"Unique identifier for the order. Starts with ord_.
sending: stored, and the send is in progress. pending: the exchange has the order. partially_filled, filled: some or all of the order has traded. uncertain: we don't know whether the exchange received it. We don't send it again; we reconcile it against the exchange's record. rejected: the exchange rejected it; see reject_reason. refused: we refused it, and it never reached the exchange. cancelled: the exchange confirmed the cancel. expired: its time in force ran out.
sending, pending, partially_filled, filled, uncertain, rejected, refused, cancelled, expired The account code, in uppercase.
The account code, in uppercase.
buy, sell limit, market day, gtc, ioc, fok The limit price in kobo. Null for a market order.
The total number of shares traded so far.
The exchange's identifier for the order, once it has one.
A sentence explaining the order's current state. It's for people to read, so don't use it in your logic.
Why the exchange rejected the order. Set only when state is rejected.
insufficient_funds, market_closed, settlement_lockout, limit_orders_etf_only, unknown_symbol, symbol_not_tradable, account_not_at_broker, rejected_by_exchange, null In UTC, to the second.
In UTC, to the second.