نقلة
Docs menuSet a store's rate card

POST Set a store's rate card

العربية

Set your rate card for this store: services, first weight and price, price per extra kg, covered cities, delivery time and cash on delivery. It wins over your default card from valid_from on. Checkout prices your service from it when the store has set no price of its own.

POST /shipping/rates
Scope
shipments.write Sensitive Action
Full address
https://naqllah.com/api/apps/v1/shipping/rates
Rate limit
120 a minute per store, 1200 a minute across all stores
The merchant reads
Record the waybill, label and tracking steps of the orders the store sends to this app, and answer cancel requests

Request

Parameters

NameInTypeDescription
Idempotency-Keyrequired header string · 8–80 A unique key of 8 to 80 characters per operation: the same request with the same key returns the same answer.

Request body

FieldTypeNotes
valid_from string date
servicesrequired array<object> —
services[].servicerequired string one of standard express same_day instant cold_chain
services[].first_kgrequired number 0.1 to 100
services[].first_pricerequired string —
services[].extra_kg_price string —
services[].citiesrequired array<string> —
services[].etarequired object —
services[].eta.unit string one of days hours
services[].eta.min integer —
services[].eta.max integer —
services[].cod object —
services[].cod.available boolean —
services[].cod.fee string —
services[].volumetric_divisor integer 1000 to 10000
JSON
{
    "carrier": "carrier_code"
}

Samples

Each sample reads the access token from the environment variable NAQLLAH_ACCESS_TOKEN.

cURL
curl -X POST "https://naqllah.com/api/apps/v1/shipping/rates" \
  -H "Authorization: Bearer $NAQLLAH_ACCESS_TOKEN" \
  -H "Idempotency-Key: order-5521-waybill-1" \
  -H "Content-Type: application/json" \
  -d '{"carrier":"carrier_code"}'
PHP
<?php
$ch = curl_init('https://naqllah.com/api/apps/v1/shipping/rates');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('NAQLLAH_ACCESS_TOKEN'),
        'Accept: application/json',
        'Idempotency-Key: order-5521-waybill-1',
        'Content-Type: application/json',
    ],
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => json_encode(['carrier' => 'carrier_code']),
]);

$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
// Node.js 18+ (fetch is built in)
const res = await fetch('https://naqllah.com/api/apps/v1/shipping/rates', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.NAQLLAH_ACCESS_TOKEN}`,
    Accept: 'application/json',
    'Idempotency-Key': 'order-5521-waybill-1',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"carrier":"carrier_code"}),
});

const json = await res.json();
if (!res.ok) throw new Error(json.error);
const { data } = json;
Python
import os
import requests

res = requests.post(
    "https://naqllah.com/api/apps/v1/shipping/rates",
    headers={
        "Authorization": f"Bearer {os.environ['NAQLLAH_ACCESS_TOKEN']}",
        "Accept": "application/json",
        "Idempotency-Key": "order-5521-waybill-1",
    },
    json={"carrier":"carrier_code"},
    timeout=10,
)

body = res.json()
if res.status_code >= 400:
    raise RuntimeError(body["error"])
data = body["data"]

Response

On success the answer is 201 with this body. The example uses sample data.

FieldTypeNotes
data object —
data.id string uuid
data.scope string —
data.status string one of running done failed refused
data.mode string one of auto notify conditions
data.reason string may be null
data.result object may be null
data.error string may be null
data.created_at string —
201 · JSON
{
    "data": {
        "id": "3c9e1f20-8b6a-4d0e-9f51-2a7c4b8d6e10",
        "scope": "waybills.create",
        "status": "done",
        "mode": "notify",
        "reason": null,
        "result": {
            "awb": "7781204512"
        },
        "error": null,
        "created_at": "2026-11-04 11:02:09"
    }
}

Errors

HTTPCodeMeaning
400idempotency_key_requiredSend an Idempotency-Key header (8 to 80 characters).
401invalid_tokenThe access token is invalid or expired.
401not_installedThe app is not installed on this store.
402payment_requiredThe app's subscription on this store is unpaid.
403app_suspendedThe app or the developer account is suspended.
403insufficient_scopeThe merchant has not granted this permission to the app.
409idempotency_key_reusedThe same Idempotency-Key was used for a different request.
422invalid_requestThe request is not valid.
429rate_limitedThe app is over its request limit. Try again shortly.

All error codes

Idempotency

Every request of this endpoint needs an Idempotency-Key header: a key of 8 to 80 characters (letters, digits and . _ : -) that names this one operation.

  • Sending the same request again with the same key returns the first answer and does nothing new; retry safely after a network failure.
  • The same key with a different body is refused with 409 idempotency_key_reused.
  • A missing or malformed key is refused with 400 idempotency_key_required.
  • Keys are kept per install: two stores never collide.

This is an action. The merchant chose at install how it runs: at once, at once with notice, or only under conditions. Read status in the answer: done, running, failed or refused.

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.

Mock Answers come from this page's examples and rules, in your browser. Nothing is sent to any store, and no token leaves this page. To call the real API, use the test store with your own token.

Trying needs JavaScript; the samples above work without it.

Version v1.0.0 Changelog Service status openapi-v1.json Support