mohamedhekal/shipbridge-bosta

Bosta carrier driver for ShipBridge (Egypt)

Maintainers

Package info

github.com/mohamedhekal/shipbridge-bosta

pkg:composer/mohamedhekal/shipbridge-bosta

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.2.0 2026-07-16 15:06 UTC

This package is auto-updated.

Last update: 2026-07-16 16:04:43 UTC


README

CI License: MIT Packagist

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

ShipBridge · bosta