curl -X PUT https://api.ordexs.com/v1/policies/returns \
-H "Authorization: Bearer $ORDEXS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "You can refuse the package at the door if it is damaged.\n\n- Report a problem within 48 hours."
}'
const res = await fetch('https://api.ordexs.com/v1/policies/returns', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.ORDEXS_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"body": "You can refuse the package at the door if it is damaged.\n\n- Report a problem within 48 hours."
}),
})
const data = await res.json()
if (!res.ok) throw new Error(`${data.error.code}: ${data.error.message}`)
<?php
$body = [
'body' => 'You can refuse the package at the door if it is damaged.
- Report a problem within 48 hours.',
];
$ch = curl_init('https://api.ordexs.com/v1/policies/returns');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ORDEXS_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($body),
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
import os
import requests
res = requests.put(
"https://api.ordexs.com/v1/policies/returns",
headers={"Authorization": f"Bearer {os.environ['ORDEXS_API_KEY']}"},
json={
"body": "You can refuse the package at the door if it is damaged.\n\n- Report a problem within 48 hours.",
},
timeout=30,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
{
"object": "policy",
"kind": "returns",
"title": "Return & refund policy",
"body": "You can refuse the package at the door if it is damaged.\n\n- Report a problem within 48 hours.",
"published": true,
"url": "https://tulips.myordexs.com/policies/returns",
"updated_at": "2026-10-13T09:00:00Z"
}
{
"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"
}
}