mohamedhekal / shipbridge-bosta
Bosta carrier driver for ShipBridge (Egypt)
v0.2.0
2026-07-16 15:06 UTC
Requires
- php: ^8.2
- illuminate/http: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- mohamedhekal/shipbridge: ^0.1
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/phpstan: ^2.0
README
Bosta (مصر) — driver كامل لـ ShipBridge
مبني على شكل الـ API الرسمي لـ Bosta Business (create / track / AWB / return / exchange).
دليل عربي مفصّل: docs/GUIDE_AR.md · مرجع API: docs/API.md
بالعربي — في ٣ خطوات
١) التثبيت
composer require mohamedhekal/shipbridge mohamedhekal/shipbridge-bosta
٢) المفاتيح في .env
SHIPBRIDGE_DRIVER=bosta BOSTA_API_KEY=your-api-key-from-bosta-dashboard BOSTA_BASE_URL=https://app.bosta.co # Staging: https://stg-app.bosta.co
المفتاح من لوحة Bosta → API Integration.
يُرسل كـAuthorization: {api_key}(مش Bearer).
٣) ابعت شحنة
use Hekal\ShipBridge\Facades\ShipBridge; use Hekal\ShipBridge\DTOs\Address; use Hekal\ShipBridge\DTOs\CreateShipmentRequest; use Hekal\ShipBridge\DTOs\Parcel; $shipment = ShipBridge::driver('bosta')->createShipment(new CreateShipmentRequest( origin: new Address('المخزن', 'شارع الصناعة ١', 'Cairo', 'EG', phone: '01011111111'), destination: new Address('أحمد علي', '١٢ شارع النيل', 'Giza', 'EG', phone: '01000000000'), parcels: [new Parcel(weightKg: 1.2, description: 'ملابس')], reference: 'ORD-42', metadata: [ 'cod' => 350, // تحصيل عند الاستلام (جنيه) 'city_code' => 'EG-02', // كود مدينة Bosta (الجيزة) 'zone' => 'الدقي', 'building_number' => 12, 'notes' => 'اتصل قبل التسليم', ], )); echo $shipment->trackingNumber; // رقم التتبع من Bosta
ShipBridge::driver('bosta')->track($shipment->trackingNumber); ShipBridge::driver('bosta')->label($shipment->trackingNumber); // AWB PDF (base64)
English — Quick start
composer require mohamedhekal/shipbridge mohamedhekal/shipbridge-bosta
SHIPBRIDGE_DRIVER=bosta BOSTA_API_KEY=your-api-key-from-bosta-dashboard BOSTA_BASE_URL=https://app.bosta.co
Bosta fields beyond the ShipBridge DTOs go in metadata (cod, city_code, zone, district_id, building_number, type, …).
| ShipBridge method | Bosta API |
|---|---|
createShipment |
POST /api/v2/deliveries?apiVersion=1 (type 10) |
track |
POST /api/v2/deliveries/search |
label |
GET /api/v2/deliveries/mass-awb |
createReturn |
create delivery type 25 (CRP) |
createExchange |
create delivery type 30 |
Delivery types
| Code | Meaning |
|---|---|
| 10 | SEND / Forward package (default) |
| 15 | Cash collection |
| 20 | Return to origin |
| 25 | Customer return pickup |
| 30 | Exchange |
Testing
composer install && composer test
License
MIT © Mohamed Hekal
