List orders
curl --request GET \
--url https://magicmarkets.com/v2/orders/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://magicmarkets.com/v2/orders/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://magicmarkets.com/v2/orders/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://magicmarkets.com/v2/orders/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "ok",
"data": [
{
"order_id": 123,
"order_type": "normal",
"bet_type": "<string>",
"bet_type_description": "<string>",
"sport": "<string>",
"want_price": 123,
"want_stake": [
"<string>",
123
],
"ccy_rate": 123,
"placement_time": "2023-11-07T05:31:56Z",
"expiry_time": "2023-11-07T05:31:56Z",
"closed": true,
"close_reason": "<string>",
"event_info": {
"event_type": "normal",
"event_id": "<string>",
"event_name": "<string>",
"home_id": 123,
"home_team": "<string>",
"away_id": 123,
"away_team": "<string>",
"competition_id": 123,
"competition_name": "<string>",
"competition_country": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"date": "2023-12-25",
"result": {
"ht_home": 123,
"ht_away": 123,
"ft_home": 123,
"ft_away": 123
},
"teams": [
{
"team_id": 123,
"name": "<string>"
}
],
"end_time": "2023-11-07T05:31:56Z",
"leg_event_infos": "<array>"
},
"bets": [
{
"bet_id": 123,
"order_id": 123,
"order_ccy_rate": 123,
"status": {
"code": "<string>",
"reason": "<string>",
"response_pmm": {
"effective": {
"price": 123,
"min": {
"[0]": "<string>",
"[1]": 123
},
"max": {
"[0]": "<string>",
"[1]": 123
}
}
}
},
"sport": "<string>",
"event_id": "<string>",
"bet_type": "<string>",
"ccy_rate": 123,
"want_price": 123,
"got_price": 123,
"want_stake": [
"<string>",
123
],
"got_stake": [
"<string>",
123
],
"profit_loss": {
"[0]": "<string>",
"[1]": 123
},
"reconciled": true,
"exchange_role": "maker"
}
],
"user_data": "<string>",
"status": "<string>",
"keep_open_ir": true,
"exchange_mode": "make_and_take",
"price": 123,
"stake": {
"[0]": "<string>",
"[1]": 123
},
"profit_loss": {
"[0]": "<string>",
"[1]": 123
},
"bet_bar_values": {},
"current_score": {
"[0]": 123,
"[1]": 123
},
"legs": [
{
"id": 123,
"sport": "<string>",
"event_id": "<string>",
"bet_type": "<string>",
"live_score": {
"home": 512,
"away": 512
},
"bet_type_description": "<string>",
"price": 123,
"outcome": "w"
}
]
}
]
}{
"status": "error",
"code": "auth_error",
"data": {
"detail": "Authentication credentials were not provided."
}
}{
"status": "error",
"code": "forbidden",
"data": null
}{
"status": "error",
"code": "throttled",
"data": {
"message": "Request was throttled. Expected available in 12 seconds.",
"retry_after": 12
}
}{
"status": "error",
"code": "server_error",
"data": [
"An error has occurred, token:",
"ABC123abc456DEF789gh"
]
}List orders
Returns a paginated list of orders for the authenticated customer.
GET
/
v2
/
orders
/
List orders
curl --request GET \
--url https://magicmarkets.com/v2/orders/ \
--header 'X-Api-Key: <api-key>'import requests
url = "https://magicmarkets.com/v2/orders/"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://magicmarkets.com/v2/orders/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://magicmarkets.com/v2/orders/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "ok",
"data": [
{
"order_id": 123,
"order_type": "normal",
"bet_type": "<string>",
"bet_type_description": "<string>",
"sport": "<string>",
"want_price": 123,
"want_stake": [
"<string>",
123
],
"ccy_rate": 123,
"placement_time": "2023-11-07T05:31:56Z",
"expiry_time": "2023-11-07T05:31:56Z",
"closed": true,
"close_reason": "<string>",
"event_info": {
"event_type": "normal",
"event_id": "<string>",
"event_name": "<string>",
"home_id": 123,
"home_team": "<string>",
"away_id": 123,
"away_team": "<string>",
"competition_id": 123,
"competition_name": "<string>",
"competition_country": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"date": "2023-12-25",
"result": {
"ht_home": 123,
"ht_away": 123,
"ft_home": 123,
"ft_away": 123
},
"teams": [
{
"team_id": 123,
"name": "<string>"
}
],
"end_time": "2023-11-07T05:31:56Z",
"leg_event_infos": "<array>"
},
"bets": [
{
"bet_id": 123,
"order_id": 123,
"order_ccy_rate": 123,
"status": {
"code": "<string>",
"reason": "<string>",
"response_pmm": {
"effective": {
"price": 123,
"min": {
"[0]": "<string>",
"[1]": 123
},
"max": {
"[0]": "<string>",
"[1]": 123
}
}
}
},
"sport": "<string>",
"event_id": "<string>",
"bet_type": "<string>",
"ccy_rate": 123,
"want_price": 123,
"got_price": 123,
"want_stake": [
"<string>",
123
],
"got_stake": [
"<string>",
123
],
"profit_loss": {
"[0]": "<string>",
"[1]": 123
},
"reconciled": true,
"exchange_role": "maker"
}
],
"user_data": "<string>",
"status": "<string>",
"keep_open_ir": true,
"exchange_mode": "make_and_take",
"price": 123,
"stake": {
"[0]": "<string>",
"[1]": 123
},
"profit_loss": {
"[0]": "<string>",
"[1]": 123
},
"bet_bar_values": {},
"current_score": {
"[0]": 123,
"[1]": 123
},
"legs": [
{
"id": 123,
"sport": "<string>",
"event_id": "<string>",
"bet_type": "<string>",
"live_score": {
"home": 512,
"away": 512
},
"bet_type_description": "<string>",
"price": 123,
"outcome": "w"
}
]
}
]
}{
"status": "error",
"code": "auth_error",
"data": {
"detail": "Authentication credentials were not provided."
}
}{
"status": "error",
"code": "forbidden",
"data": null
}{
"status": "error",
"code": "throttled",
"data": {
"message": "Request was throttled. Expected available in 12 seconds.",
"retry_after": 12
}
}{
"status": "error",
"code": "server_error",
"data": [
"An error has occurred, token:",
"ABC123abc456DEF789gh"
]
}Authorizations
API key created from the magic-markets website
Query Parameters
Page number
Required range:
x >= 1Results per page
Required range:
1 <= x <= 1000Filter by status (open, pending, done, failed)
Filter by sport code - see "Sports & bet types" in the introduction.
Filter by event ID
Filter by order type (normal, lay, parlay)
Start of date range (ISO 8601)
End of date range (ISO 8601)
Free-text search

