Before you begin
The sandbox is athttps://gateway-sandbox.matambaintelligence.com. The live host comes with your live keys.
When we set up your sandbox access, we send you a sandbox API key and two account codes: one to trade with, and one ending in 99 that has a zero balance, so you can test a rejected order.
The examples use these placeholders:
Each step shows the request, and a
curl command that sends it. The commands read the placeholders as shell variables, so set them once, such as KEY=mgw_test_..., and each command runs as written.
Send every request with the Authorization: Bearer $KEY header. Request and response bodies are JSON. Amounts are integers in kobo, so ₦475.00 is 47500, and a field ending in _kobo_decimal is a decimal string of kobo.
Place your first order
1
List your accounts
Confirm that your key works and see which accounts you can trade for.
Response
2
Estimate the cost
Get an estimate before you place the order. An estimate doesn’t place or store anything.A market order is priced at the day’s price limit: the upper limit for a buy, the lower limit for a sell. In the sandbox, the limits are 10% either side of the listed price, and charges are a flat 1.5%. This estimate works out as follows:
Response
The sandbox then fills the order at ₦475.00, so the account pays
482125 kobo: 10 × 47500, plus 1.5%. A sell estimate is priced at the lower limit and is what you’d receive after charges. In live, the estimate is the broker’s figure: it includes the consideration, statutory charges and commission, and it’s indicative.3
Place the order
Response
pending state means the order is open at the exchange.To see a rejected order, place the same order on $ACCOUNT_99 with a new key. It returns 422 order_rejected with reject_reason insufficient_funds.4
Check the order status
The sandbox fills market orders immediately. We check the broker for fills about every 30 seconds. If you’ve registered a webhook endpoint, we send it an
order.filled event. Either way, the event is in GET /v1/events. Wait 30 seconds, then retrieve the order. If it still reads pending, retrieve it again a few seconds later.Response
5
View the position
The filled order now appears as a position on the account.
Response
Run this guide in Postman
Import the Postman collection and the sandbox environment, then fill inapi_key, account and account_99 in the environment. Its base_url is already the sandbox’s address. The collection runs these five requests in order, then requests for common errors. It refuses to run with anything but a sandbox key.
To generate a client in your own language, use the OpenAPI file.