curl https://api.ordexs.com/v1/delivery/settings \
-H "Authorization: Bearer $ORDEXS_API_KEY"
const res = await fetch('https://api.ordexs.com/v1/delivery/settings', {
headers: {
Authorization: `Bearer ${process.env.ORDEXS_API_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`)
<?php
$ch = curl_init('https://api.ordexs.com/v1/delivery/settings');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORDEXS_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
import os
import requests
res = requests.get(
"https://api.ordexs.com/v1/delivery/settings",
headers={"Authorization": f"Bearer {os.environ['ORDEXS_API_KEY']}"},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
{
"object": "delivery_settings",
"enabled": true,
"strategy": "flat",
"modes": {
"home": true,
"pickup_point": true
},
"labels": {
"home": "Door delivery",
"pickup_point": "Stop desk"
},
"courier_ids": [],
"fallback_to_flat_prices": true,
"default_courier_id": "cour_4e5f6a7b8c9d40e1f2a3b4c5d6e7f8a9"
}
{
"error": {
"code": "insufficient_scope",
"message": "This API key does not have the \"orders:write\" permission. Edit the key's permissions under Settings → Developers, or use a key that has it.",
"details": {
"required_scope": "orders:write"
},
"request_id": "req_7f3a9c2e41b84d0c9a1e5f6b"
}
}