GET Read a routed order's shipping details
What a carrier app needs to deliver an order routed to it: recipient, address, payment (cash on delivery amount), lines and parcel. Any other order answers 404.
GET
/orders/{id}/shipping
- Scope
shipping.ordersSensitive- Full address
https://naqllah.com/api/apps/v1/orders/{id}/shipping- Rate limit
- 120 a minute per store, 1200 a minute across all stores
- The merchant reads
- Read the recipient, address and cash-on-delivery amount of the orders the store sends to this app for shipping
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired |
path | integer · ≥ 1 |
The numeric id. |
Samples
Each sample reads the access token from the environment variable NAQLLAH_ACCESS_TOKEN.
curl "https://naqllah.com/api/apps/v1/orders/5521/shipping" \
-H "Authorization: Bearer $NAQLLAH_ACCESS_TOKEN"
<?php
$ch = curl_init('https://naqllah.com/api/apps/v1/orders/5521/shipping');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('NAQLLAH_ACCESS_TOKEN'),
'Accept: application/json',
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$json = json_decode($body, true);
if ($status >= 400) {
throw new RuntimeException($json['error'] ?? 'http_' . $status);
}
$data = $json['data'];
// Node.js 18+ (fetch is built in)
const res = await fetch('https://naqllah.com/api/apps/v1/orders/5521/shipping', {
headers: {
Authorization: `Bearer ${process.env.NAQLLAH_ACCESS_TOKEN}`,
Accept: 'application/json',
},
});
const json = await res.json();
if (!res.ok) throw new Error(json.error);
const { data } = json;
import os
import requests
res = requests.get(
"https://naqllah.com/api/apps/v1/orders/5521/shipping",
headers={
"Authorization": f"Bearer {os.environ['NAQLLAH_ACCESS_TOKEN']}",
"Accept": "application/json",
},
timeout=10,
)
body = res.json()
if res.status_code >= 400:
raise RuntimeError(body["error"])
data = body["data"]
Response
On success the answer is 200 with this body. The example uses sample data.
| Field | Type | Notes |
|---|---|---|
data |
object |
— |
data.order_id |
integer |
— |
data.number |
string |
— |
data.recipient |
object |
— |
data.recipient.name |
string |
— |
data.recipient.phone |
string |
— |
data.address |
object |
— |
data.address.line1 |
string |
— |
data.address.district |
string |
— |
data.address.city |
string |
— |
data.address.postcode |
string |
— |
data.address.country |
string |
— |
data.address.short_address |
string |
may be null |
data.address.lat |
number |
may be null |
data.address.lng |
number |
may be null |
data.address.notes |
string |
may be null |
data.payment |
object |
— |
data.payment.method |
string |
one of prepaid cod
|
data.payment.cod_amount |
string |
SAR, two decimals, as text |
data.items |
array<object> |
— |
data.items[].id |
integer |
— |
data.items[].sku |
string |
may be null |
data.items[].name |
string |
may be null |
data.items[].variant_id |
integer |
may be null |
data.items[].quantity |
integer |
— |
data.items[].unit_price |
string |
SAR, two decimals, as text |
data.items[].weight_g |
integer |
may be null |
data.declared_value |
string |
SAR, two decimals, as text |
data.currency |
string |
— |
data.parcel |
object |
— |
data.parcel.weight_kg |
number |
— |
data.parcel.pieces |
integer |
— |
data.parcel.dimensions_cm |
object |
may be null |
data.parcel.dimensions_cm.length |
number |
— |
data.parcel.dimensions_cm.width |
number |
— |
data.parcel.dimensions_cm.height |
number |
— |
{
"data": {
"order_id": 5521,
"number": "NQ-10482",
"recipient": {
"name": "سارة العتيبي",
"phone": "+966500000000"
},
"address": {
"line1": "شارع الأمير سلطان 12",
"district": "الروضة",
"city": "جدة",
"postcode": "23435",
"country": "SA",
"short_address": "RRRD2929",
"lat": null,
"lng": null,
"notes": null
},
"payment": {
"method": "cod",
"cod_amount": "489.00"
},
"items": [
{
"id": 9001,
"sku": "TS-BLK-M",
"name": "قميص قطني أسود",
"variant_id": 44,
"quantity": 2,
"unit_price": "89.00",
"weight_g": 350
}
],
"declared_value": "489.00",
"currency": "SAR",
"parcel": {
"weight_kg": 0.7,
"pieces": 1,
"dimensions_cm": null
}
}
}
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 401 | invalid_token | The access token is invalid or expired. |
| 401 | not_installed | The app is not installed on this store. |
| 402 | payment_required | The app's subscription on this store is unpaid. |
| 403 | app_suspended | The app or the developer account is suspended. |
| 403 | insufficient_scope | The merchant has not granted this permission to the app. |
| 404 | not_found | Not found. |
| 429 | rate_limited | The app is over its request limit. Try again shortly. |
Rate limits
120 requests a minute per store, and 1200 requests a minute for your app across all stores. Over the limit you get 429 with Retry-After. Every answer carries X-RateLimit-Limit and X-RateLimit-Remaining.
Try it
Fill in the request and see the answer this endpoint gives.
Version v1.0.0 Changelog Service status openapi-v1.json Support