List an account's trades
curl --request GET \
--url https://{host}/v1/accounts/{account}/trades \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/accounts/{account}/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v1/accounts/{account}/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/accounts/{account}/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "list",
"has_more": false,
"next_cursor": null,
"data": [
{
"object": "trade",
"ticket": "<string>",
"order_id": "<string>",
"exchange_order_id": "<string>",
"symbol": "<string>",
"name": "<string>",
"side": "buy",
"quantity": 123,
"price_kobo": 123,
"trade_date": "2023-12-25"
}
]
}{
"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>"
}
}List an account's trades
Returns buy and sell fills with a trade date from from to to, newest first. A range can include at most 1,000 records.
GET
/
v1
/
accounts
/
{account}
/
trades
List an account's trades
curl --request GET \
--url https://{host}/v1/accounts/{account}/trades \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/accounts/{account}/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v1/accounts/{account}/trades"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/v1/accounts/{account}/trades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"object": "list",
"has_more": false,
"next_cursor": null,
"data": [
{
"object": "trade",
"ticket": "<string>",
"order_id": "<string>",
"exchange_order_id": "<string>",
"symbol": "<string>",
"name": "<string>",
"side": "buy",
"quantity": 123,
"price_kobo": 123,
"trade_date": "2023-12-25"
}
]
}{
"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.
Path Parameters
One of your account codes, from GET /v1/accounts. An account code. Case-insensitive on input, and returned in uppercase.
Pattern:
^[A-Za-z0-9]{1,64}$Query Parameters
The first trade date, in Lagos time. Defaults to 30 days before to. Can't be after to.
The last trade date, in Lagos time. Defaults to today. Can't be after today.