Skip to main content
POST

Authorizations

Authorization
string
header
required

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.

Scopes

trade

Body

application/json

The order to place or estimate.

Send numbers as JSON numbers, not quoted strings. We reject unknown fields and any field that appears twice, even with different letter case.

account
string
required

An account code. Case-insensitive on input, and returned in uppercase.

Pattern: ^[A-Za-z0-9]{1,64}$
symbol
string
required

The exchange's symbol, treated as uppercase. The exchange decides whether the symbol exists.

Pattern: ^[A-Za-z0-9.-]{1,20}$
side
enum<string>
required

buy or sell.

Available options:
buy,
sell
quantity
integer<int64>
required

The number of shares, as a whole number. At least 1. The broker doesn't publish a minimum of its own. If the broker refuses a quantity, the order comes back order_rejected with reject_reason rejected_by_exchange.

Required range: 1 <= x <= 100000000
type
enum<string>
required

An ETF takes limit orders only. Shares take limit and market orders. The broker rejects a market order on an ETF with reject_reason set to etf_limit_orders_only. A market order is priced at the day's price limit: the upper limit for a buy, the lower limit for a sell.

Available options:
limit,
market
time_in_force
enum<string>
required

day: good for the current trading session only. gtc: good till cancelled. ioc: immediate or cancel. fok: fill or kill. We accept every type with every time_in_force. The broker decides which combinations it supports, and rejects the rest as order_rejected with a reject_reason. If it refuses an order with a reason it doesn't publish, the order is uncertain until our operations team reconciles it.

Available options:
day,
gtc,
ioc,
fok
price_kobo
integer<int64>

The limit price in kobo, so ₦475.00 is 47500. Required for a limit order. Omit it for a market order.

Required range: 1 <= x <= 1000000000
client_reference
string

Your own reference for this, such as your internal ID, so you can find it again. 1 to 64 printable ASCII characters, with no spaces, matched exactly. We store it and return it. It's part of the request an Idempotency-Key stands for, so a retry with a different client_reference returns 409. Never put personal data in it: no names, phone numbers, email addresses, BVN, NIN or account numbers of your customers.

Required string length: 1 - 64
Pattern: ^[!-~]{1,64}$
Example:

"ord-88213"

Response

The estimate.

The broker's estimate for an order. An estimate doesn't place or store anything.

object
string
required
Allowed value: "order_estimate"
account
string
required

The account code, in uppercase.

symbol
string
required

The symbol, in uppercase.

side
enum<string>
required

buy or sell, as sent. New values can be added: handle an unrecognised value with a safe default.

Available options:
buy,
sell
quantity
integer<int64>
required

The number of shares, as sent.

type
enum<string>
required

limit or market, as sent. New values can be added: handle an unrecognised value with a safe default.

Available options:
limit,
market
time_in_force
enum<string>
required

As sent. New values can be added: handle an unrecognised value with a safe default.

Available options:
day,
gtc,
ioc,
fok
price_kobo
integer<int64> | null
required

The limit price in kobo. Null for a market order.

estimated_total_kobo
integer<int64>
required

The broker's estimate of the order's total, rounded to the whole kobo against the customer. For a buy, what the order would cost, rounded up. For a sell, what you'd receive, rounded down. In the sandbox, a buy includes 1.5% charges and a sell is net of them. The estimate is indicative, not a quote.

estimated_total_kobo_decimal
string
required

The broker's estimate of the order's total, in kobo, as an exact decimal string, because the broker's charges can include fractions of a kobo. estimated_total_kobo is this figure rounded up for a buy and down for a sell.

Example:

"59831.63125"