Skip to content

omnibus/bluedart API reference

Floor
Provider · Omnibus
Version
2.x
Conformance suite
runs, no CI read
Verified for real
Not verified for real
Licence
MIT
composer require omnibus/bluedart:2.x-dev

Read from the package's own PHP files at the commit ea60ef0faabe: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnibus\Bluedart

  • Api class

    Blue Dart's APIs (apigateway.bluedart.com): a JWT from the Token API with the client id and secret, then the Transit (serviceability and transit time), Waybill (shipments and labels), Tracking and Cancel APIs.

    4 methods · 5 properties · 2 constants

  • BluedartGatewayFactory class

    options: client_id: '%env(BLUEDART_CLIENT_ID)%' # the API gateway app (bluedart.com/developer) client_secret: '%env(BLUEDART_CLIENT_SECRET)%' login_id: '%env(BLUEDART_LOGIN)%' # the ShipDart profile: login id, licence_key: '%env(BLUEDART_LICENCE)%' # licence key and customer_code: '%env(BLUEDART_CUSTOMER)%' # customer code origin_area: BOM # the account's area code sandbox: true rates: [...] # prices from configuration: the Transit API quotes none

    12 options

Omnibus\Bluedart\Action

  • CancelAction class

    The Waybill API's CancelWaybill.

    3 methods

  • RatingAction class

    The Transit API's GetDomesticTransitTimeForPinCodeandProduct: whether the lane is served and in how many days, for each product (A Domestic Priority, E Dart Apex, D Dart Surfaceline). Blue Dart quotes no price: the amount is the shipment's "prices" option per product (minor units), and a product without a price is not rated (nor asked about).

    3 methods

  • ShippingAction class

    The Waybill API's GenerateWayBill: the AWB number and its label (PDF). Service: the product code (A Domestic Priority by default, E, D).

    3 methods

  • TrackingAction class

    The Tracking API: the waybill's scans, oldest first.

    3 methods

Omnibus\Bluedart

Api class

final class Api Api.php:15

Blue Dart's APIs (apigateway.bluedart.com): a JWT from the Token API with the client id and secret, then the Transit (serviceability and transit time), Waybill (shipments and labels), Tracking and Cancel APIs.

const LIVE = 'https://apigateway.bluedart.com'
const TEST = 'https://apigateway-sandbox.bluedart.com'
public readonly string $loginId
public readonly string $licenceKey
public readonly string $customerCode
public readonly ?string $originArea
public readonly bool $sandbox

Api::__construct()

public function __construct(readonly HttpClientInterface $http, readonly string $clientId, readonly string $clientSecret, public readonly string $loginId, public readonly string $licenceKey, public readonly string $customerCode, public readonly ?string $originArea = null, public readonly bool $sandbox = false, readonly int $timeout = 20)

Api::base()

public function base(): string

Api::profile()

public function profile(): array

Api::call()

public function call(string $method, string $path, ?array $body = null, array $query = []): array

BluedartGatewayFactory class

final class BluedartGatewayFactory extends GatewayFactory BluedartGatewayFactory.php:26

options: client_id: '%env(BLUEDART_CLIENT_ID)%' # the API gateway app (bluedart.com/developer) client_secret: '%env(BLUEDART_CLIENT_SECRET)%' login_id: '%env(BLUEDART_LOGIN)%' # the ShipDart profile: login id, licence_key: '%env(BLUEDART_LICENCE)%' # licence key and customer_code: '%env(BLUEDART_CUSTOMER)%' # customer code origin_area: BOM # the account's area code sandbox: true rates: [...] # prices from configuration: the Transit API quotes none

No pickup points: Blue Dart delivers to the door. Unverified until an account's keys are at hand.

Options

OptionDefault
origin_areanull
sandboxfalse
omnibus.apifunction (Config $c) { $http = $this->http ?? HttpClient::create(); return new Api($http, (string) $c['client_id'], (string) $c['client_secret'], (st…
omnibus.action.ratingstatic fn(Config $c) => $c->get('rates') ? null : new RatingAction()
omnibus.action.shippingnew ShippingAction()
omnibus.action.trackingnew TrackingAction()
omnibus.action.cancelnew CancelAction()
client_idrequired
client_secretrequired
login_idrequired
licence_keyrequired
customer_coderequired

Omnibus\Bluedart\Action

CancelAction class

final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13

The Waybill API's CancelWaybill.

CancelAction::__construct()

public function __construct()

CancelAction::supports()

public function supports(Request $request): bool

CancelAction::execute()

public function execute(Request $request): void

RatingAction class

final class RatingAction implements ActionInterface, ApiAwareInterface RatingAction.php:20

The Transit API's GetDomesticTransitTimeForPinCodeandProduct: whether the lane is served and in how many days, for each product (A Domestic Priority, E Dart Apex, D Dart Surfaceline). Blue Dart quotes no price: the amount is the shipment's "prices" option per product (minor units), and a product without a price is not rated (nor asked about).

RatingAction::__construct()

public function __construct()

RatingAction::supports()

public function supports(Request $request): bool

RatingAction::execute()

public function execute(Request $request): void

ShippingAction class

final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:16

The Waybill API's GenerateWayBill: the AWB number and its label (PDF). Service: the product code (A Domestic Priority by default, E, D).

ShippingAction::__construct()

public function __construct()

ShippingAction::supports()

public function supports(Request $request): bool

ShippingAction::execute()

public function execute(Request $request): void

TrackingAction class

final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:16

The Tracking API: the waybill's scans, oldest first.

TrackingAction::__construct()

public function __construct()

TrackingAction::supports()

public function supports(Request $request): bool

TrackingAction::execute()

public function execute(Request $request): void