ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices.
Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service.
If you're new to REST APIs then be sure to read our introduction to REST to understand the basics. Learn how to authenticate yourself to ShipEngine, and then use our sandbox environment to kick the tires and get familiar with our API. If you run into any problems, then be sure to check the error handling guide for tips.
Here are some step-by-step tutorials to get you started:
- Learn how to create your first shipping label
- Calculate shipping costs and compare rates across carriers
- Track packages on-demand or in real time
- Validate mailing addresses anywhere on Earth
ShipEngine makes it easy to create shipping labels for any carrier and download them in a variety of file formats. You can even customize labels with your own messages and images.
With ShipEngine you can get the current status of a package or subscribe to real-time tracking updates via webhooks. You can also create custimized tracking pages with your own branding so your customers will always know where their package is.
Make sure you ship as cost-effectively as possible by comparing rates across carriers using the ShipEngine Rates API. Or if you don't know the full shipment details yet, then you can get rate estimates with limited address info.
ShipEngine supports address validation for virtually every country on Earth, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 1.1.202009151309
- Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit https://www.shipengine.com/contact/
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/dacardworld/shipengineapi.git"
}
],
"require": {
"dacardworld/shipengineapi": "*@dev"
}
}Then run composer install
Download the files and include autoload.php:
require_once('/path/to/ShipEngineApi/vendor/autoload.php');To run the unit tests:
composer install
./vendor/bin/phpunitPlease follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = ShipEngineApi\Configuration::getDefaultConfiguration()->setApiKey('API-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ShipEngineApi\Configuration::getDefaultConfiguration()->setApiKeyPrefix('API-Key', 'Bearer');
$apiInstance = new ShipEngineApi\Api\AddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$parse_address_request_body = {"text":"Margie McMiller at 3800 North Lamar suite 200 in austin, tx. The zip code there is 78652."}; // \ShipEngineApi\Model\ParseAddressRequestBody | The only required field is `text`, which is the text to be parsed. You can optionally also provide an `address` containing already-known values. For example, you may already know the recipient's name, city, and country, and only want to parse the street address into separate lines.
try {
$result = $apiInstance->parseAddress($parse_address_request_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->parseAddress: ', $e->getMessage(), PHP_EOL;
}
?>All URIs are relative to https://api.shipengine.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AddressesApi | parseAddress | PUT /v1/addresses/recognize | Parse an address |
| AddressesApi | validateAddress | POST /v1/addresses/validate | Validate An Address |
| BatchesApi | addToBatch | POST /v1/batches/{batch_id}/add | Add to a Batch |
| BatchesApi | createBatch | POST /v1/batches | Create A Batch |
| BatchesApi | deleteBatch | DELETE /v1/batches/{batch_id} | Delete Batch By Id |
| BatchesApi | getBatchByExternalId | GET /v1/batches/external_batch_id/{external_batch_id} | Get Batch By External ID |
| BatchesApi | getBatchById | GET /v1/batches/{batch_id} | Get Batch By ID |
| BatchesApi | listBatchErrors | GET /v1/batches/{batch_id}/errors | Get Batch Errors |
| BatchesApi | listBatches | GET /v1/batches | List Batches |
| BatchesApi | processBatch | POST /v1/batches/{batch_id}/process/labels | Process Batch ID Labels |
| BatchesApi | removeFromBatch | POST /v1/batches/{batch_id}/remove | Remove From Batch |
| BatchesApi | updateBatch | PUT /v1/batches/{batch_id} | Update Batch By Id |
| CarrierAccountsApi | connectCarrier | POST /v1/connections/carriers/{carrier_name} | Connect a carrier account |
| CarrierAccountsApi | disconnectCarrier | DELETE /v1/connections/carriers/{carrier_name}/{carrier_id} | Disconnect a carrier |
| CarrierAccountsApi | getCarrierSettings | GET /v1/connections/carriers/{carrier_name}/{carrier_id}/settings | Get carrier settings |
| CarrierAccountsApi | updateCarrierSettings | PUT /v1/connections/carriers/{carrier_name}/{carrier_id}/settings | Update carrier settings |
| CarriersApi | addFundsToCarrier | PUT /v1/carriers/{carrier_id}/add_funds | Add Funds To Carrier |
| CarriersApi | getCarrierById | GET /v1/carriers/{carrier_id} | Get Carrier By ID |
| CarriersApi | getCarrierOptions | GET /v1/carriers/{carrier_id}/options | Get Carrier Options |
| CarriersApi | listCarrierPackageTypes | GET /v1/carriers/{carrier_id}/packages | List Carrier Package Types |
| CarriersApi | listCarrierServices | GET /v1/carriers/{carrier_id}/services | List Carrier Services |
| CarriersApi | listCarriers | GET /v1/carriers | List Carriers |
| DownloadsApi | downloadFile | GET /v1/downloads/{dir}/{subdir}/{filename} | Download File |
| InsuranceApi | addFundsToInsurance | PATCH /v1/insurance/shipsurance/add_funds | Add Funds To Insurance |
| InsuranceApi | connectInsurer | POST /v1/connections/insurance/shipsurance | Connect a Shipsurance Account |
| InsuranceApi | disconnectInsurer | DELETE /v1/connections/insurance/shipsurance | Disconnect a Shipsurance Account |
| InsuranceApi | getInsuranceBalance | GET /v1/insurance/shipsurance/balance | Get Insurance Funds Balance |
| LabelsApi | createLabel | POST /v1/labels | Purchase Label |
| LabelsApi | createLabelFromRate | POST /v1/labels/rates/{rate_id} | Purchase Label with Rate ID |
| LabelsApi | createLabelFromShipment | POST /v1/labels/shipment/{shipment_id} | Purchase Label with Shipment ID |
| LabelsApi | createReturnLabel | POST /v1/labels/{label_id}/return | Create a return label |
| LabelsApi | getLabelByExternalShipmentId | GET /v1/labels/external_shipment_id/{external_shipment_id} | Get Label By External Shipment ID |
| LabelsApi | getLabelById | GET /v1/labels/{label_id} | Get Label By ID |
| LabelsApi | getTrackingLogFromLabel | GET /v1/labels/{label_id}/track | Get Label Tracking Information |
| LabelsApi | listLabels | GET /v1/labels | List labels |
| LabelsApi | voidLabel | PUT /v1/labels/{label_id}/void | Void a Label By ID |
| ManifestsApi | createManifest | POST /v1/manifests | Create Manifest |
| ManifestsApi | getManifestById | GET /v1/manifests/{manifest_id} | Get Manifest By Id |
| ManifestsApi | listManifests | GET /v1/manifests | List Manifests |
| PackageTypesApi | createPackageType | POST /v1/packages | Create Custom Package Type |
| PackageTypesApi | deletePackageType | DELETE /v1/packages/{package_id} | Delete A Custom Package By ID |
| PackageTypesApi | getPackageTypeById | GET /v1/packages/{package_id} | Get Custom Package Type By ID |
| PackageTypesApi | listPackageTypes | GET /v1/packages | List Custom Package Types |
| PackageTypesApi | updatePackageType | PUT /v1/packages/{package_id} | Update Custom Package Type By ID |
| RatesApi | calculateRates | POST /v1/rates | Get Shipping Rates |
| RatesApi | compareBulkRates | POST /v1/rates/bulk | Get Bulk Rates |
| RatesApi | estimateRates | POST /v1/rates/estimate | Estimate Rates |
| RatesApi | getRateById | GET /v1/rates/{rate_id} | Get Rate By ID |
| ShipmentsApi | cancelShipments | PUT /v1/shipments/{shipment_id}/cancel | Cancel a Shipment |
| ShipmentsApi | createShipments | POST /v1/shipments | Create Shipments |
| ShipmentsApi | getShipmentByExternalId | GET /v1/shipments/external_shipment_id/{external_shipment_id} | Get Shipment By External ID |
| ShipmentsApi | getShipmentById | GET /v1/shipments/{shipment_id} | Get Shipment By ID |
| ShipmentsApi | listShipmentErrors | GET /v1/shipments/{shipment_id}/errors | Get Shipment Errors |
| ShipmentsApi | listShipmentRates | GET /v1/shipments/{shipment_id}/rates | Get Shipment Rates |
| ShipmentsApi | listShipments | GET /v1/shipments | List Shipments |
| ShipmentsApi | parseShipment | PUT /v1/shipments/recognize | Parse shipping info |
| ShipmentsApi | tagShipment | POST /v1/shipments/{shipment_id}/tags/{tag_name} | Add Tag to Shipment |
| ShipmentsApi | untagShipment | DELETE /v1/shipments/{shipment_id}/tags/{tag_name} | Remove Tag from Shipment |
| ShipmentsApi | updateShipment | PUT /v1/shipments/{shipment_id} | Update Shipment By ID |
| TagsApi | createTag | POST /v1/tags/{tag_name} | Create a New Tag |
| TagsApi | deleteTag | DELETE /v1/tags/{tag_name} | Delete Tag |
| TagsApi | listTags | GET /v1/tags | Get Tags |
| TagsApi | renameTag | PUT /v1/tags/{tag_name}/{new_tag_name} | Update Tag Name |
| TrackingApi | getTrackingLog | GET /v1/tracking | Get Tracking Information |
| TrackingApi | startTracking | POST /v1/tracking/start | Start Tracking a Package |
| TrackingApi | stopTracking | POST /v1/tracking/stop | Stop Tracking a Package |
| WarehousesApi | createWarehouse | POST /v1/warehouses | Create Warehouse |
| WarehousesApi | deleteWarehouse | DELETE /v1/warehouses/{warehouse_id} | Delete Warehouse By ID |
| WarehousesApi | getWarehouseById | GET /v1/warehouses/{warehouse_id} | Get Warehouse By Id |
| WarehousesApi | listWarehouses | GET /v1/warehouses | List Warehouses |
| WarehousesApi | updateWarehouse | PUT /v1/warehouses/{warehouse_id} | Update WareHouse By Id |
| WebhooksApi | createWebhook | POST /v1/environment/webhooks | Create a Webhook |
| WebhooksApi | deleteWebhook | DELETE /v1/environment/webhooks/{webhook_id} | Delete Webhook By ID |
| WebhooksApi | getWebhookById | GET /v1/environment/webhooks/{webhook_id} | Get Webhook By ID |
| WebhooksApi | listWebhooks | GET /v1/environment/webhooks | List Webhooks |
| WebhooksApi | updateWebhook | PUT /v1/environment/webhooks/{webhook_id} | Update a Webhook |
- AddFundsToCarrierRequestBody
- AddFundsToCarrierResponseBody
- AddFundsToInsuranceRequestBody
- AddFundsToInsuranceResponseBody
- AddToBatchRequestBody
- Address
- AddressResidentialIndicator
- AddressToValidate
- AddressValidatingShipment
- AddressValidationCode
- AddressValidationDetailCode
- AddressValidationMessageType
- AddressValidationResult
- AddressValidationStatus
- AdvancedShipmentOptions
- AncillaryServiceEndorsement
- Batch
- BatchResponseError
- BatchStatus
- BatchesSortBy
- BillToParty
- BulkRate
- CalculateRatesRequestBody
- CalculateRatesResponseBody
- Carrier
- CarrierAdvancedOption
- CarrierName
- CarrierNameWithSettings
- CollectOnDelivery
- CollectOnDeliveryPaymentType
- CompareBulkRatesRequestBody
- ConnectAccessWorldwideRequestBody
- ConnectAmazonBuyShippingRequestBody
- ConnectApcRequestBody
- ConnectAsendiaRequestBody
- ConnectAustraliaPostRequestBody
- ConnectCanadaPostRequestBody
- ConnectCarrierRequestBody
- ConnectCarrierResponseBody
- ConnectDhlEcommerceRequestBody
- ConnectDhlExpressAuRequestBody
- ConnectDhlExpressCaRequestBody
- ConnectDhlExpressRequestBody
- ConnectDhlExpressUkRequestBody
- ConnectDpdRequestBody
- ConnectEndiciaRequestBody
- ConnectFedexRequestBody
- ConnectFedexUkRequestBody
- ConnectFirstmileRequestBody
- ConnectGlobegisticsRequestBody
- ConnectImexRequestBody
- ConnectInsurerRequestBody
- ConnectNewgisticsRequestBody
- ConnectOntracRequestBody
- ConnectPurolatorRequestBody
- ConnectRoyalMailRequestBody
- ConnectRrDonnelleyRequestBody
- ConnectSekoRequestBody
- ConnectSendleRequestBody
- ConnectStampsRequestBody
- ConnectUpsRequestBody
- CreateAndValidateShipment
- CreateBatchRequestBody
- CreateBatchResponseBody
- CreateLabelFromRateRequestBody
- CreateLabelFromRateResponseBody
- CreateLabelFromShipmentRequestBody
- CreateLabelFromShipmentResponseBody
- CreateLabelRequestBody
- CreateLabelResponseBody
- CreateManifestByObjectRequestBody
- CreateManifestLabelIdsRequestBody
- CreateManifestRequestBody
- CreateManifestResponseBody
- CreatePackageTypeRequestBody
- CreatePackageTypeResponseBody
- CreateReturnLabelRequestBody
- CreateReturnLabelResponseBody
- CreateShipmentResponseBodyFields
- CreateShipmentsRequestBody
- CreateShipmentsResponseBody
- CreateTagResponseBody
- CreateWarehouseRequestBody
- CreateWarehouseResponseBody
- CreateWebhookRequestBody
- CreateWebhookResponseBody
- Currency
- CustomsItem
- DeliveryConfirmation
- DeprecatedManifest
- DhlExpressAccountSettings
- DhlExpressSettingsResponseBody
- DimensionUnit
- Dimensions
- Error
- ErrorCode
- ErrorResponseBody
- ErrorSource
- ErrorType
- EstimateRatesRequestBody
- FedexAccountSettings
- FedexAccountSettingsRequestBody
- FedexPickupType
- FedexSettingsResponseBody
- GetBatchByExternalIdResponseBody
- GetBatchByIdResponseBody
- GetCarrierByIdResponseBody
- GetCarrierOptionsResponseBody
- GetCarrierSettingsResponseBody
- GetCarriersResponseBody
- GetInsuranceBalanceResponseBody
- GetLabelByExternalShipmentIdResponseBody
- GetLabelByIdResponseBody
- GetManifestByIdResponseBody
- GetPackageTypeByIdResponseBody
- GetRateByIdResponseBody
- GetShipmentByExternalIdResponseBody
- GetShipmentByIdResponseBody
- GetTrackingLogFromLabelResponseBody
- GetTrackingLogResponseBody
- GetWarehouseByIdResponseBody
- GetWebhookByIdResponseBody
- InsuranceProvider
- InternationalShipmentOptions
- Label
- LabelChargeEvent
- LabelDownload
- LabelDownloadType
- LabelFormat
- LabelLayout
- LabelMessages
- LabelStatus
- Link
- ListBatchErrorsResponseBody
- ListBatchesResponseBody
- ListCarrierPackageTypesResponseBody
- ListCarrierServicesResponseBody
- ListCarriersResponseBody
- ListLabelsResponseBody
- ListManifestsResponseBody
- ListPackageTypesResponseBody
- ListShipmentErrorsResponseBody
- ListShipmentRatesResponseBody
- ListShipmentsResponseBody
- ListTagsResponseBody
- ListWarehousesResponseBody
- Manifest
- ManifestDownload
- Manifests
- ModifyBatch
- MonetaryValue
- NonDelivery
- OptionalLink
- OrderSourceName
- Package
- PackageContents
- PackageType
- PagedListResponseBody
- PaginationLink
- ParseAddressRequestBody
- ParseAddressResponseBody
- ParseShipmentRequestBody
- ParseShipmentResponseBody
- PartialAddress
- PartialShipment
- PaymentAmount
- ProcessBatchRequestBody
- PurchaseLabelWithoutShipment
- Rate
- RateEstimate
- RateEstimateByCarrierId
- RateEstimateByCarrierIds
- RateEstimateOptions
- RateRequestBody
- RateRequestByShipmentIds
- RateRequestByShipments
- RateRequestOptions
- RateRequestRateOptions
- RateResponse
- RateResponseStatus
- RateType
- RatesInformation
- RecognizedEntity
- RemoveFromBatchRequestBody
- ResponseMessage
- Service
- Shipment
- ShipmentIdRequest
- ShipmentItem
- ShipmentRequest
- ShipmentResponseError
- ShipmentStatus
- ShipmentsSortBy
- SmartPostHub
- SortDir
- Tag
- TagShipmentResponseBody
- TrackEvent
- TrackingInformation
- TrackingStatus
- UpdateAmazonBuyShippingRequestBody
- UpdateCarrierSettingsRequestBody
- UpdateDhlExpressSettingsRequestBody
- UpdateFedexSettingsRequestBody
- UpdateNewgisticsSettingsRequestBody
- UpdatePackageTypeRequestBody
- UpdateShipmentFields
- UpdateShipmentRequestBody
- UpdateShipmentResponseBody
- UpdateUpsSettingsRequestBody
- UpdateWarehouseRequestBody
- UpdateWebhookRequestBody
- UpsAccountSettings
- UpsInvoice
- UpsPickupType
- UpsSettingsResponseBody
- ValidateAddress
- ValidateShipmentFields
- ValidationStatus
- VoidLabelResponseBody
- Warehouse
- Webhook
- WebhookEvent
- Weight
- WeightUnit
- Type: API key
- API key parameter name: API-Key
- Location: HTTP header