The Shipping Package API gives the application many ways to manage the shipment of packages to their destination. # Reference - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/business-rules%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/business-rules\" target="_blank" rel="noopener">Business Rules - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/appendix1%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/appendix1\" target="_blank" rel="noopener">Appendix 1 - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/appendix2%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/appendix2\" target="_blank" rel="noopener">Appendix 2 - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/errors%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/errors\" target="_blank" rel="noopener">Errors - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/faq%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/faq\" target="_blank" rel="noopener">FAQ - <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://developer.ups.com/api/reference/shipping/best-practices%5C" rel="nofollow">https://developer.ups.com/api/reference/shipping/best-practices\" target="_blank" rel="noopener noreferrer"> Best Practices
Try out UPS APIs with example requests using Postman. Explore API documentation and sample applications through GitHub.
<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://god.gw.postman.com/run-collection/29542085-af2f70b3-405b-4aee-af8d-1eb715e4cebc?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D29542085-af2f70b3-405b-4aee-af8d-1eb715e4cebc%26entityType%3Dcollection%26workspaceId%3D7e7595f0-4829-4f9a-aee1-75c126b9d417%5C" rel="nofollow">https://god.gw.postman.com/run-collection/29542085-af2f70b3-405b-4aee-af8d-1eb715e4cebc?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D29542085-af2f70b3-405b-4aee-af8d-1eb715e4cebc%26entityType%3Dcollection%26workspaceId%3D7e7595f0-4829-4f9a-aee1-75c126b9d417\" target="_blank" rel="noopener noreferrer"> <img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://run.pstmn.io/button.svg%5C" rel="nofollow">https://run.pstmn.io/button.svg\" alt="Run In Postman" style="width: 128px; height: 32px;"> <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://github.com/UPS-API%5C">https://github.com/UPS-API\" target="_blank" rel="noopener noreferrer"> <img src="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Ca+href%3D"https://www.ups.com/assets/resources/webcontent/images/gitHubButton.svg%5C" rel="nofollow">https://www.ups.com/assets/resources/webcontent/images/gitHubButton.svg\" alt="Open in GitHub " style="width: 128px; height: 32px;">This PHP package is automatically generated by the Swagger Codegen project:
- API version:
- Package version: 1.0.9
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/abantecart/ups-shipping.git"
}
],
"require": {
"abantecart/ups-shipping": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php:
require_once('/path/to/Shipping/vendor/autoload.php');To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = UPS\Shipping\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new UPS\Shipping\Request\ShippingApi(
// 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
);
$body = new \UPS\Shipping\Shipping\SHIPRequestWrapper(); // \UPS\Shipping\Shipping\SHIPRequestWrapper | Generate sample code for popular API requests by selecting an example below. To view a full sample request and response, first click \"Authorize\" and enter your application credentials, then populate the required parameters above and click \"Try it out\".
$deprecated_version = "deprecated_version_example"; // string | Indicates Ship API to display the new release features in Ship API response based on Ship release. Valid values: - v1 - v1601 - v1607 - v1701 - v1707 - v1801 - v1807 - v2108 - v2205
$trans_id = "trans_id_example"; // string | An identifier unique to the request. Length 32
$transaction_src = "testing"; // string | An identifier of the client/source application that is making the request.Length 512
$additionaladdressvalidation = "additionaladdressvalidation_example"; // string | Valid Values: city = validation will include city.Length 15
try {
$result = $apiInstance->deprecatedShipment($body, $deprecated_version, $trans_id, $transaction_src, $additionaladdressvalidation);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ShippingApi->deprecatedShipment: ', $e->getMessage(), PHP_EOL;
}
// Configure OAuth2 access token for authorization: OAuth2
$config = UPS\Shipping\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new UPS\Shipping\Request\ShippingApi(
// 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
);
$deprecated_version = "deprecated_version_example"; // string | API Version. Valid values: - v1
$shipmentidentificationnumber = "shipmentidentificationnumber_example"; // string | The shipment's identification number Alpha-numeric. Must pass 1Z rules. Must be upper case. Length 18
$trans_id = "trans_id_example"; // string | An identifier unique to the request. Length 32
$transaction_src = "testing"; // string | An identifier of the client/source application that is making the request.Length 512
$trackingnumber = "trackingnumber_example"; // string | The package's tracking number. You may have up to 20 different tracking numbers listed. If more than one tracking number, pass this value as: trackingnumber= [\"1ZISUS010330563105\",\"1ZISUS01033056310 8\"] with a coma separating each number. Alpha-numeric. Must pass 1Z rules. Must be upper case. Length 18
try {
$result = $apiInstance->deprecatedVoidShipment($deprecated_version, $shipmentidentificationnumber, $trans_id, $transaction_src, $trackingnumber);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ShippingApi->deprecatedVoidShipment: ', $e->getMessage(), PHP_EOL;
}
// Configure OAuth2 access token for authorization: OAuth2
$config = UPS\Shipping\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new UPS\Shipping\Request\ShippingApi(
// 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
);
$body = new \UPS\Shipping\Shipping\LABELRECOVERYRequestWrapper(); // \UPS\Shipping\Shipping\LABELRECOVERYRequestWrapper | Generate sample code for popular API requests by selecting an example below. To view a full sample request and response, first click \"Authorize\" and enter your application credentials, then populate the required parameters above and click \"Try it out\".
$version = "version_example"; // string | When UPS introduces new elements in the response that are not associated with new request elements, Subversion is used. This ensures backward compatibility. v1 original features of the application. No support for CODTurn-inPage, HighValueReport or InternationalForms features returned in the response v1701 includes support for CODTurn-inPage features returned in the response. V1903 Length 5
$trans_id = "trans_id_example"; // string | An identifier unique to the request. Length 32
$transaction_src = "testing"; // string | An identifier of the client/source application that is making the request.Length 512
try {
$result = $apiInstance->labelRecovery($body, $version, $trans_id, $transaction_src);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ShippingApi->labelRecovery: ', $e->getMessage(), PHP_EOL;
}
// Configure OAuth2 access token for authorization: OAuth2
$config = UPS\Shipping\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new UPS\Shipping\Request\ShippingApi(
// 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
);
$body = new \UPS\Shipping\Shipping\SHIPRequestWrapper(); // \UPS\Shipping\Shipping\SHIPRequestWrapper | Generate sample code for popular API requests by selecting an example below. To view a full sample request and response, first click \"Authorize\" and enter your application credentials, then populate the required parameters above and click \"Try it out\".
$version = "version_example"; // string | Indicates Ship API to display the new release features in Ship API response based on Ship release. Valid values: - v2409
$trans_id = "trans_id_example"; // string | An identifier unique to the request. Length 32
$transaction_src = "testing"; // string | An identifier of the client/source application that is making the request.Length 512
$additionaladdressvalidation = "additionaladdressvalidation_example"; // string | Valid Values: city = validation will include city.Length 15
try {
$result = $apiInstance->shipment($body, $version, $trans_id, $transaction_src, $additionaladdressvalidation);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ShippingApi->shipment: ', $e->getMessage(), PHP_EOL;
}
// Configure OAuth2 access token for authorization: OAuth2
$config = UPS\Shipping\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new UPS\Shipping\Request\ShippingApi(
// 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
);
$version = "version_example"; // string | API Version Valid values: - v2409
$shipmentidentificationnumber = "shipmentidentificationnumber_example"; // string | The shipment's identification number Alpha-numeric. Must pass 1Z rules. Must be upper case. Length 18
$trans_id = "trans_id_example"; // string | An identifier unique to the request. Length 32
$transaction_src = "testing"; // string | An identifier of the client/source application that is making the request.Length 512
$trackingnumber = "trackingnumber_example"; // string | The package's tracking number. You may have up to 20 different tracking numbers listed. If more than one tracking number, pass this value as: trackingnumber= [\"1ZISUS010330563105\",\"1ZISUS01033056310 8\"] with a coma separating each number. Alpha-numeric. Must pass 1Z rules. Must be upper case. Length 18
try {
$result = $apiInstance->voidShipment($version, $shipmentidentificationnumber, $trans_id, $transaction_src, $trackingnumber);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ShippingApi->voidShipment: ', $e->getMessage(), PHP_EOL;
}
?>All URIs are relative to https://wwwcie.ups.com/api
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ShippingApi | deprecatedShipment | POST /shipments/{deprecatedVersion}/ship | Shipment |
| ShippingApi | deprecatedVoidShipment | DELETE /shipments/{deprecatedVersion}/void/cancel/{shipmentidentificationnumber} | Void Shipment |
| ShippingApi | labelRecovery | POST /labels/{version}/recovery | Label Recovery |
| ShippingApi | shipment | POST /shipments/{version}/ship | Shipment |
| ShippingApi | voidShipment | DELETE /shipments/{version}/void/cancel/{shipmentidentificationnumber} | Void Shipment |
- AddressPOE
- AdjustedHeightUnitOfMeasurement
- AgentTaxIdentificationNumberTaxIdentificationNumber
- AlternateDeliveryAddressAddress
- BillReceiverAddress
- BillShipperCreditCard
- BillThirdPartyAddress
- BillingWeightUnitOfMeasurement
- CN22ContentCN22ContentWeight
- CN22ContentWeightUnitOfMeasurement
- CN22FormCN22Content
- CODCODAmount
- CODTurnInPageImage
- CODTurnInPageImageImageFormat
- CommodityNMFC
- CommonErrorResponse
- ContactsForwardAgent
- ContactsIntermediateConsignee
- ContactsProducer
- ContactsSoldTo
- ContactsUltimateConsignee
- ControlLogReceiptImageFormat
- CreditCardAddress
- DDTCInformationUnitOfMeasurement
- DeclaredValueType
- DimWeightUnitOfMeasurement
- DimensionsUnitOfMeasurement
- DryIceDryIceWeight
- DryIceWeightUnitOfMeasurement
- DryIceWeightWeight
- EEIFilingOptionShipperFiled
- EEIFilingOptionUPSFiled
- EEIInformationDDTCInformation
- EEIInformationLicense
- ErrorMessage
- ErrorResponse
- FRSPaymentInformationAddress
- FRSPaymentInformationType
- FRSShipmentDataFreightDensityRate
- FRSShipmentDataHandlingUnits
- FRSShipmentDataTransportationCharges
- FormImage
- ForwardAgentAddress
- FreightDensityInfoAdjustedHeight
- FreightDensityInfoHandlingUnits
- FreightShipmentInformationFreightDensityInfo
- GlobalTaxInformationAgentTaxIdentificationNumber
- GlobalTaxInformationDestinationCountryShipmentValue
- GlobalTaxInformationOriginCountryShipmentValue
- GlobalTaxInformationShipperTypeValue
- HandlingUnitsAdjustedHeight
- HandlingUnitsDimensions
- HandlingUnitsType
- HandlingUnitsUnitOfMeasurement
- HighValueReportImage
- HighValueReportImageImageFormat
- ImageImageFormat
- IntermediateConsigneeAddress
- InternationalFormsBlanketPeriod
- InternationalFormsCN22Form
- InternationalFormsContacts
- InternationalFormsDiscount
- InternationalFormsEEIFilingOption
- InternationalFormsFreightCharges
- InternationalFormsInsuranceCharges
- InternationalFormsOtherCharges
- InternationalFormsProduct
- InternationalFormsUPSPremiumCareForm
- InternationalFormsUserCreatedForm
- LABELRECOVERYRequestWrapper
- LABELRECOVERYResponseWrapper
- LRCODTurnInPageImage
- LRCODTurnInPageImageImageFormat
- LRFormImage
- LRRequestTransactionReference
- LRResponseResponseStatus
- LRResponseTransactionReference
- LabelDeliveryEMail
- LabelImageLabelImageFormat
- LabelRecoveryFormImage
- LabelRecoveryImageImageFormat
- LabelRecoveryLabelSpecificationLabelImageFormat
- LabelRecoveryLabelSpecificationLabelStockSize
- LabelRecoveryRequest
- LabelRecoveryRequestLabelDelivery
- LabelRecoveryRequestLabelSpecification
- LabelRecoveryRequestReferenceValues
- LabelRecoveryRequestRequest
- LabelRecoveryRequestTranslate
- LabelRecoveryRequestUPSPremiumCareForm
- LabelRecoveryResponse
- LabelRecoveryResponseCODTurnInPage
- LabelRecoveryResponseForm
- LabelRecoveryResponseHighValueReport
- LabelRecoveryResponseLabelResults
- LabelRecoveryResponseResponse
- LabelRecoveryResponseTrackingCandidate
- LabelResultsForm
- LabelResultsLabelImage
- LabelResultsMailInnovationsLabelImage
- LabelResultsReceipt
- LabelSpecificationInstruction
- LabelSpecificationLabelImageFormat
- LabelSpecificationLabelStockSize
- MailInnovationsLabelImageLabelImageFormat
- NegotiatedChargesItemizedCharges
- NegotiatedChargesRateModifier
- NegotiatedRateChargesItemizedCharges
- NegotiatedRateChargesRateModifier
- NegotiatedRateChargesTaxCharges
- NegotiatedRateChargesTotalCharge
- NegotiatedRateChargesTotalChargesWithTaxes
- NotificationEMail
- NotificationLocale
- NotificationTextMessage
- NotificationVoiceMessage
- OneOfLabelRecoveryResponseTrackingCandidate
- PackageCommodity
- PackageDimWeight
- PackageDimensions
- PackageHazMatPackageInformation
- PackageLevelResultsStatus
- PackagePackageServiceOptions
- PackagePackageWeight
- PackagePackaging
- PackageReferenceNumber
- PackageResultsAccessorial
- PackageResultsBaseServiceCharge
- PackageResultsForm
- PackageResultsItemizedCharges
- PackageResultsNegotiatedCharges
- PackageResultsRateModifier
- PackageResultsServiceOptionsCharges
- PackageResultsShippingLabel
- PackageResultsShippingReceipt
- PackageResultsSimpleRate
- PackageServiceOptionsAccessPointCOD
- PackageServiceOptionsCOD
- PackageServiceOptionsCODCODAmount
- PackageServiceOptionsDeclaredValue
- PackageServiceOptionsDeliveryConfirmation
- PackageServiceOptionsDryIce
- PackageServiceOptionsHazMat
- PackageServiceOptionsNotification
- PackageServiceOptionsNotificationEMail
- PackageSimpleRate
- PackageUPSPremier
- PackageWeightUnitOfMeasurement
- PackingListInfoPackageAssociated
- PaymentInformationShipmentCharge
- PreAlertNotificationEMailMessage
- PreAlertNotificationLocale
- PreAlertNotificationTextMessage
- PreAlertNotificationVoiceMessage
- ProducerAddress
- ProducerPhone
- ProductEEIInformation
- ProductExcludeFromForm
- ProductNetCostDateRange
- ProductPackingListInfo
- ProductProductWeight
- ProductScheduleB
- ProductUnit
- ProductWeightUnitOfMeasurement
- ReceiptImage
- ReceiptImageImageFormat
- ReceiptSpecificationImageFormat
- ReferenceValuesReferenceNumber
- RequestTransactionReference
- ResponseAlert
- ResponseResponseStatus
- ResponseTransactionReference
- SHIPRequestWrapper
- SHIPResponseWrapper
- ScheduleBUnitOfMeasurement
- ShipFromAddress
- ShipFromPhone
- ShipFromTaxIDType
- ShipFromVendorInfo
- ShipToAddress
- ShipToPhone
- ShipmentAlternateDeliveryAddress
- ShipmentChargeBillReceiver
- ShipmentChargeBillShipper
- ShipmentChargeBillThirdParty
- ShipmentChargesBaseServiceCharge
- ShipmentChargesItemizedCharges
- ShipmentChargesServiceOptionsCharges
- ShipmentChargesTaxCharges
- ShipmentChargesTotalCharges
- ShipmentChargesTotalChargesWithTaxes
- ShipmentChargesTransportationCharges
- ShipmentDGSignatoryInfo
- ShipmentFRSPaymentInformation
- ShipmentFreightShipmentInformation
- ShipmentGlobalTaxInformation
- ShipmentInvoiceLineTotal
- ShipmentPackage
- ShipmentPaymentInformation
- ShipmentPromotionalDiscountInformation
- ShipmentReferenceNumber
- ShipmentRequest
- ShipmentRequestLabelSpecification
- ShipmentRequestReceiptSpecification
- ShipmentRequestRequest
- ShipmentRequestShipment
- ShipmentResponse
- ShipmentResponseResponse
- ShipmentResponseShipmentResults
- ShipmentResultsBillingWeight
- ShipmentResultsCODTurnInPage
- ShipmentResultsControlLogReceipt
- ShipmentResultsDisclaimer
- ShipmentResultsFRSShipmentData
- ShipmentResultsForm
- ShipmentResultsFormImage
- ShipmentResultsHighValueReport
- ShipmentResultsImageImageFormat
- ShipmentResultsNegotiatedRateCharges
- ShipmentResultsPackageResults
- ShipmentResultsShipmentCharges
- ShipmentReturnService
- ShipmentService
- ShipmentServiceOptionsAccessPointCOD
- ShipmentServiceOptionsCOD
- ShipmentServiceOptionsDeliveryConfirmation
- ShipmentServiceOptionsInternationalForms
- ShipmentServiceOptionsLabelDelivery
- ShipmentServiceOptionsLabelMethod
- ShipmentServiceOptionsNotification
- ShipmentServiceOptionsPreAlertNotification
- ShipmentServiceOptionsRestrictedArticles
- ShipmentShipFrom
- ShipmentShipTo
- ShipmentShipmentIndicationType
- ShipmentShipmentRatingOptions
- ShipmentShipmentServiceOptions
- ShipmentShipper
- ShipmentWorldEase
- ShipmentWorldEasePortOfEntry
- ShipperAddress
- ShipperPhone
- ShippingLabelImageFormat
- ShippingReceiptImageFormat
- SoldToAddress
- SoldToPhone
- SummaryResultStatus
- TaxIDTypeCode
- TaxIDTypeDescription
- TrackingCandidatePickupDateRange
- TransportationChargesDiscountAmount
- TransportationChargesGrossCharge
- TransportationChargesNetCharge
- UPSFiledPOA
- UPSPremierHandlingInstructions
- UPSPremiumCareFormLanguageForUPSPremiumCare
- UltimateConsigneeAddress
- UltimateConsigneeUltimateConsigneeType
- UnitUnitOfMeasurement
- VOIDSHIPMENTRequestWrapper
- VOIDSHIPMENTResponseWrapper
- VoidRequestTransactionReference
- VoidResponseResponseStatus
- VoidResponseTransactionReference
- VoidShipmentRequest
- VoidShipmentRequestRequest
- VoidShipmentRequestVoidShipment
- VoidShipmentResponse
- VoidShipmentResponsePackageLevelResults
- VoidShipmentResponseResponse
- VoidShipmentResponseSummaryResult
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes: