Download the PHP package yusufthedragon/shipper-php without Composer
On this page you can find all versions of the php package yusufthedragon/shipper-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yusufthedragon/shipper-php
More information about yusufthedragon/shipper-php
Files in yusufthedragon/shipper-php
Package shipper-php
Short Description PHP Clients for Shipper API
License GPL-3.0-only
Informations about the package shipper-php
Shipper API PHP Client
Unofficial library for access Shipper API from applications written with PHP.
- Installation
- Usage
- Set the API Key
- Set the Production Mode
- Available Methods and Examples
- Locations
- Get Countries
- Get Provinces
- Get Cities
- Get Origin Cities
- Get Suburbs
- Get Areas
- Search Location
- Rates
- Get Domestic Rates
- Get International Rates
- Orders
- Create Domestic Order
- Create International Order
- Get Tracking ID
- Activate Order
- Get Order Detail
- Update Order
- Cancel Order
- Pickup Orders
- Create Pickup Request
- Cancel Pickup Request
- Get Agents by Suburb
- Furthermore
- Get All Tracking Status
- Generate AWB Number
- Exceptions
- ArgumentCountError
- InvalidArgumentException
- ClientException
- Contributing
Installation
Install shipper-php with composer by following command:
or add it manually in your composer.json
file.
Usage
Set the API Key
Configure package with your account's api key obtained from Shipper.
Set the Production Mode
When deploying your application to production, you may want to change API Endpoint as well by setting setProductionMode
to true
.
Available Methods and Examples
Locations
Get Countries
Retrieve country data in a list.
Usage example:
Get Provinces
Retrieve all provinces in Indonesia in a list.
Usage example:
Get Cities
Retrieve cities based on submitted province ID.
Usage example:
Get Origin Cities
Retrieve provinces in which Shipper provides pickup service.
Usage example:
Get Suburbs
Retrieve suburbs based on submitted city ID.
Usage example:
Get Areas
Retrieve areas based on submitted suburb ID.
Usage example:
Search Location
Retrieve every area, suburb, and city whose names include the submitted substring (including postcode).
Usage example:
Rates
Get Domestic Rates
Usage example:
Get International Rates
Usage example:
Orders
Create Domestic Order
Usage example:
Create International Order
Usage example:
Get Tracking ID
Retrieve tracking ID of the order with the provided ID.
Usage example:
Activate Order
Activate/Deactivate an order. Such activation will initiate Shipper's pickup process.
Usage example:
Get Order Detail
Retrieve an order's detail. Date format is UTC time.
Usage example:
Update Order
Update an order's package's weight and dimension.
Usage example:
Cancel Order
Cancel an order.
Usage example:
Pickup Orders
Create Pickup Request
Assign agent and activate orders.
Usage examples
Cancel Pickup Request
Cancel pickup request.
Usage example:
Get Agents by Suburb
Get agent by origin suburb ID.
Usage example:
Furthermore
Get All Tracking Status
Usage example:
Generate AWB Number
Generate AWB from related logistic, in case that AWB number in order is not generated yet when order sent.
Exceptions
ArgumentCountError
ArgumentCountError
will be thrown if too few arguments are passed to a function or method.
For example, argument cityId
must be passed to function getCities
. If user does not provide one, ArgumentCountError
will be thrown.
InvalidArgumentException
InvalidArgumentException
will be thrown if the argument provided by user is not sufficient to create the request, or if an argument is not of the excepted type.
For example, there are required arguments such as l
, w
, h
, and wt
to update an order. If user lacks one or more arguments when attempting to create one, or if one or more arguments are not integer
nor float
, InvalidArgumentException
will be thrown.
ClientException
ClientException
will be thrown if a client error is encountered (4xx codes) when send request to API.
For example, if order is not found when create a pickup request, ClientException
will be thrown.
Contributing
For any requests, bugs, or comments, please open an issue or submit a pull request.