ShipEngine
in package
Exposes the functionality of the ShipEngine API.
Table of Contents
- $addressService : AddressService
- A collection of methods to call the ShipEngine Address Validation Services.
- $config : ShipEngineConfig
- Global configuration for the ShipEngine API client, such as timeouts, retries, page size, etc. This configuration applies to all method calls, unless specifically overridden when calling a method.
- $logger : ShipEngineLogger
- ShipEngineLogger class.
- $trackingService : TrackPackageService
- Methods that allow you to track a package by **packageId** or by *trackingNumber* and **carrierCode** using an instance of the **TrackingQuery** class that has those properties.
- __construct() : mixed
- Instantiates the ShipEngine class. The `apiKey` you pass in can be either a ShipEngine sandbox or production API Key. (sandbox keys start with "TEST_)
- getCarrierAccounts() : array<string|int, mixed>
- normalizeAddress() : Address
- Normalize a given address into a standardized format used by carriers.
- trackPackage() : TrackPackageResult
- Track a package by `trackingNumber` and `carrierCode` via the **TrackingQuery** object, by using just the **packageId**, or by using a **Package** object.
- validateAddress() : AddressValidateResult
- Validate an address in nearly any countryCode in the world.
Properties
$addressService
A collection of methods to call the ShipEngine Address Validation Services.
protected
AddressService
$addressService
$config
Global configuration for the ShipEngine API client, such as timeouts, retries, page size, etc. This configuration applies to all method calls, unless specifically overridden when calling a method.
protected
ShipEngineConfig
$config
$logger
ShipEngineLogger class.
protected
ShipEngineLogger
$logger
$trackingService
Methods that allow you to track a package by **packageId** or by *trackingNumber* and **carrierCode** using an instance of the **TrackingQuery** class that has those properties.
protected
TrackPackageService
$trackingService
Methods
__construct()
Instantiates the ShipEngine class. The `apiKey` you pass in can be either a ShipEngine sandbox or production API Key. (sandbox keys start with "TEST_)
public
__construct([mixed $config = null ]) : mixed
Parameters
- $config : mixed = null
-
Can be either a string that is your
apiKeyor anarray{apiKey:string, baseUrl:string, pageSize:int, retries:int, timeout:int, eventListener:object}
Return values
mixed —getCarrierAccounts()
public
getCarrierAccounts([string|null $carrierCode = null ][, array<string|int, mixed>|ShipEngineConfig|null $config = null ]) : array<string|int, mixed>
Parameters
- $carrierCode : string|null = null
- $config : array<string|int, mixed>|ShipEngineConfig|null = null
-
Optional configuration overrides for this method call {apiKey:string, baseUrl:string, pageSize:int, retries:int, timeout:int, client:HttpClient|null}
Tags
Return values
array<string|int, mixed> —An array of CarrierAccount objects that correspond the to carrier accounts connected to a given ShipEngine account.
normalizeAddress()
Normalize a given address into a standardized format used by carriers.
public
normalizeAddress(Address $address[, array<string|int, mixed>|ShipEngineConfig|null $config = null ]) : Address
Parameters
- $address : Address
- $config : array<string|int, mixed>|ShipEngineConfig|null = null
-
Optional configuration overrides for this method call {apiKey:string, baseUrl:string, pageSize:int, retries:int, timeout:int, client:HttpClient|null}
Tags
Return values
Address —trackPackage()
Track a package by `trackingNumber` and `carrierCode` via the **TrackingQuery** object, by using just the **packageId**, or by using a **Package** object.
public
trackPackage(mixed $tracking_data[, array<string|int, mixed>|ShipEngineConfig|null $config = null ]) : TrackPackageResult
Parameters
- $tracking_data : mixed
- $config : array<string|int, mixed>|ShipEngineConfig|null = null
-
Optional configuration overrides for this method call {apiKey:string, baseUrl:string, pageSize:int, retries:int, timeout:int, client:HttpClient|null}
Tags
Return values
TrackPackageResult —validateAddress()
Validate an address in nearly any countryCode in the world.
public
validateAddress(Address $address[, array<string|int, mixed>|ShipEngineConfig|null $config = null ]) : AddressValidateResult
Parameters
- $address : Address
-
The address to validate. This can even be an incomplete or improperly formatted address.
- $config : array<string|int, mixed>|ShipEngineConfig|null = null
-
Optional configuration overrides for this method call {apiKey:string, baseUrl:string, pageSize:int, retries:int, timeout:int, client:HttpClient|null}