GROperator

جارٍ التحميل…

English

عروض الأسعار

الطلب POST /pricing/quote يخبرك بتكلفة الشحنة وهل يمكن توصيلها، دون إنشاء أي شيء: لا شحنة ولا رقم تتبع ولا استهلاك من الحصة. يسعّر كما يسعّر إنشاء الشحنة تماماً: بطاقة أسعار التاجر ومنطقة الوجهة ورسوم المناولة ورسوم الدفع عند الاستلام. النطاق: pricing:read.

جسم الطلب يشبه الشحنة بتفاصيل أقل: الأماكن والطرد والدفع ونوع الخدمة ودرجتها.

الحقل التفاصيل
merchant معرّف التاجر أو اسم حسابه بدقة؛ تُطبَّق بطاقة أسعاره. اختياري: بدونه تُطبَّق تسعيرة الشركة الافتراضية. مطلوب في عروض return. وحساب التاجر يسعّر لنفسه دائماً
pickup city مطلوب؛ وcountry اختياري؛ وdistrict اختياري (إن أرسلته يجب أن يكون موجوداً)
recipient الحقول الثلاثة نفسها
parcel weightKg وlengthCm وwidthCm وheightCm مطلوبة. وعلامات المناولة (fragile وliquid ...) قد تضيف رسوماً
payment.codAmount يضيف رسوم الدفع عند الاستلام
serviceType delivery (الافتراضي) أو exchange أو return
serviceTier standard (الافتراضي) أو express أو sameDay
POST /pricing/quote
curl -X POST "https://api.goldrock.live/api/public/v1/pricing/quote" \
  -H "X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "merchant": "Noor Electronics",
  "pickup": {
    "country": "SA",
    "city": "Riyadh",
    "district": "Al Olaya"
  },
  "recipient": {
    "country": "SA",
    "city": "Jeddah",
    "district": "Al Rawdah"
  },
  "parcel": {
    "weightKg": 1.5,
    "lengthCm": 20,
    "widthCm": 15,
    "heightCm": 10
  },
  "payment": {
    "codAmount": 199.5
  },
  "serviceType": "delivery",
  "serviceTier": "standard"
}'
JSON
{
  "deliverable": true,
  "reason": null,
  "shippingFee": 25,
  "codFee": 5,
  "total": 30,
  "chargeableWeightKg": 1.5,
  "zone": {
    "id": "d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f70",
    "name": "Zone 2"
  },
  "breakdown": [
    {
      "code": "baseShipping",
      "label": "Base shipping",
      "amount": 25
    },
    {
      "code": "codFee",
      "label": "Cash on delivery fee",
      "amount": 5
    }
  ]
}
الحقل المعنى
deliverable false حين لا تغطي شركتك الاستلام أو الوجهة، أو لا تملك بطاقة أسعار
reason سبب تعذر التوصيل: destination_not_covered أو pickup_not_covered أو rate_card_not_found
shippingFee الرسوم دون رسوم الدفع عند الاستلام: سعر الوزن ورسوم المناولة
codFee رسوم تحصيل المبلغ عند الاستلام
total shippingFee + codFee. ويساوي payment.shippingFee للشحنة التي تنشئها بعد ذلك
chargeableWeightKg الأكبر من الوزن الفعلي والوزن الحجمي
zone منطقة التسعير التي طُبّقت
breakdown بنود السعر (baseShipping وhandling وcodFee وreverseAdjustment)؛ مجموعها total

وجهة أو استلام خارج تغطيتك ليس خطأ. الرد 200 مع deliverable: false وبلا أسعار، فتعرض «لا نوصّل إلى هناك بعد» بدل رسالة فشل:

JSON
{
  "deliverable": false,
  "reason": "destination_not_covered",
  "shippingFee": null,
  "codFee": null,
  "total": null,
  "chargeableWeightKg": null,
  "zone": null,
  "breakdown": []
}

أما مكان غير موجود أصلاً فهو خطأ: 422 برموز geo_* وقيمة details.field هي pickup أو recipient، راجع الأماكن بالاسم.

لحاسبة أسعار عامة احذف merchant فتُطبَّق تسعيرة الشركة الافتراضية:

POST /pricing/quote
curl -X POST "https://api.goldrock.live/api/public/v1/pricing/quote" \
  -H "X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "X-API-Secret: YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
  "pickup": {
    "country": "SA",
    "city": "Riyadh"
  },
  "recipient": {
    "country": "SA",
    "city": "Dammam"
  },
  "parcel": {
    "weightKg": 2,
    "lengthCm": 30,
    "widthCm": 20,
    "heightCm": 15
  },
  "serviceTier": "express"
}'

استدعِ عرض السعر من خادمك وأعد للصفحة ما تحتاجه فقط. أعد التسعير حين يغيّر الزائر المسار أو الوزن أو درجة الخدمة أو مبلغ التحصيل، وسعّر مرة أخيرة قبل إنشاء الشحنة لأن الشحنة تُسعَّر ببطاقة الأسعار وقت الإنشاء.