واجهة المطورينDeveloper API

اربط متجرك بمسار: اطلب الأسعار، أنشئ الشحنة، واطبع البوليصة من نظامك.Connect your store to Masar: ask for prices, create the shipment and print the waybill from your own system.

نسخة أولية: العنوان الأساسي الحقيقي يظهر في صفحة "ربط المتجر" داخل حسابك بعد التفعيل. الأسعار نهائية بالريال وقبل ضريبة القيمة المضافة.Preview: the real base address appears on the "Store connection" page inside your account once it is active. Prices are final, in SAR, before VAT.

المصادقةAuthentication

الطلبات المتاحةEndpoints

الطريقةMethodالمسارPathالوصفWhat it does
GET/v1/walletرصيد المحفظة بالريال.Wallet balance in SAR.
GET/v1/citiesقائمة المدن المقبولة.The cities we accept.
POST/v1/ratesالأسعار وأوقات التوصيل لكل شركة، مرتبة من الأرخص.Prices and delivery times per courier, cheapest first.
POST/v1/shipmentsإنشاء شحنة وخصم سعرها من المحفظة. التكرار بنفس المرجع آمن ولا يخصم مرتين.Create a shipment and take its price from the wallet. Repeating the same reference is safe and never charges twice.
GET/v1/shipmentsآخر 100 شحنة.Your latest 100 shipments.
GET/v1/shipments/{id}شحنة واحدة بحالتها ورقم التتبع.One shipment with its status and tracking number.
POST/v1/shipments/{id}/cancelإلغاء قبل الاستلام واسترداد المبلغ كاملًا.Cancel before pickup and get the full amount back.
POST/v1/shipments/{id}/label-linkرابط مؤقت (5 دقائق) لطباعة بوليصة الشركة.A temporary link (5 minutes) to print the courier waybill.
GET/v1/shipments/{id}/labelملف PDF للبوليصة كما أصدرتها الشركة.The waybill PDF exactly as the courier made it.

مثال: الأسعارExample: prices

قواعد مهمةRules that matter

جاهز تبدأ؟Ready to start?

افتح حسابك اليوم، وأرسل أول شحنة بعد تفعيل الحساب.Open your account today and send your first shipment once it is activated.

إنشاء حساب مجانيCreate a free account