- Fixes an issue with how query params were sent when using the
addCreditCard
function
- Fix parameters for retrieving next page of child users
- Adds new
Claim
service for filing claims on EasyPost shipments and insurances
- Adds new
shipment.recommendShipDate
,smartrate.recommendShipDate
, andsmartrate.estimateDeliveryDate
functions - Routes
UpsAccount
,UpsMailInnovationsAccount
, andUpsSurepostAccount
create/update requests to the new/ups_oauth_registrations
endpoint- Starting
2024-08-05
, UPS accounts will require a new payload to register or update. See UPS OAuth 2.0 Update for more details
- Starting
- Fix payment method funding and deletion failures due to undetermined payment method type
- Adds
refund
function in Insurance service for requesting a refund for a standalone insurance
- Add
allChildren
andgetNextPageOfChildren
methods touser
service
Upgrading major versions of this project? Refer to the Upgrade Guide.
- Drops support for PHP 7.4
- Adds support for PHP 8.3
- Persists the HTTP client inside of the
EasyPostClient
via thehttpClient
property to reduce memory consumption on consecutive requests - Adds type declarations for parameters and return values throughout the library, corrects docstrings to match
- Removed
withCarbonOffset
parameter fromcreate
,buy
, andregenerateRates
functions of the Shipment service as EasyPost now offers Carbon Neutral shipments by default for free - Fixes a bug where the original filtering criteria of
all
calls wasn't passed along togetNextPage
calls. Now, these are persisted via a_params
key on response objects locally - Removes the undocumented
createAndBuy
function from theBatch
service. The proper usage is to create a batch first and buy it separately - Renames
primaryOrSecondary
topriority
to match the API name for the parameter - Corrects the order of the
userId
andemail
parameters in theupdateEmail
function of the ReferralCustomer service to match the rest of the library where IDs are always the first parameter - Fix various bugs throughout the library
- Fixes a bug that globally reset the timezone to UTC instead of setting the timezone per-request (closes #310)
- Deprecates API key-related functions in the
user
service and introduces the replacement functions in theapi_keys
service - Fixes a bug that changed the timezone to UTC on each request without resetting it to the original timezone in use (closes #310)
- Fixes documentation generation command invocation
- Fix endpoint for creating a FedEx Smartpost carrier account
- Adds new
RequestHook
andResponseHook
events. (un)subscribe to them with the newsubscribeToRequestHook
,subscribeToResponseHook
,unsubscribeFromRequestHook
, orunsubscribeFromResponseHook
methods of anEasyPostClient
- Maps 400 status codes to new
BadRequestException
class
- Migrates carrier metadata to GA (now available via
client.carrierMetadata.retrieve
)
- Adds
retrieveEstimatedDeliveryDate
function to the Shipment class
- Adds beta
retrieveCarrierMetadata
function - Improves Error Deserialization to dynamically handle edge cases that have a bad format
- Add
getNextPage
function that retrieves the next page of results for a paginated collection
- Adds missing
status_detail
property to Tracker - Fixes spelling of
weight
property on Parcel
- Adds beta
retrieveStatelessRates
function - Adds
getLowestStatelessRate
utility - Correct HTTP 403 status responses to throw
ForbiddenException
- Various other small corrections and improvements
- Added function to retrieve all pickups via
$client->pickup->all()
- Added payload functions
retrievePayload
andretrieveAllPayloads
methods, accessible via$client->event
service.
- Adds new beta billing functionality for referral customer users, accessible via the
$client->betaReferralCustomer
serviceaddPaymentMethod
to add an existing Stripe bank account or credit card to your EasyPost accountrefundByAmount
refunds you wallet balance by a specified amountrefundByPaymentLog
refunds you wallet balance by a specified payment log
Upgrading major versions of this project? Refer to the Upgrade Guide.
- Release final version of v6 that contains all the changes in the
v6.0.0-rc1
below
- PHP 7.3 is no longer supported
- Added a new
EasyPostClient
object which encapsulates the API key. All functions are called against this client allowing for thread-safety (eg:$client->shipment->create()
)- All instance methods and the ability to have objects update in-place has been removed due to this rearchitecture. When updating objects or performing actions on them (eg: creating a label/scanform), you will need to assign the return value to a variable and use that moving forward instead of relying on the object getting updated without capturing the new return value
->save()
instance methods are nowupdate()
static methods- Functions no longer accept an API key as an optional parameter
- EasyPost objects no longer contain the logic associated with them; instead, we have
Services
for each EasyPost object. All the services are properties of anEasyPostClient
. You can then call functions on a Service.
- All function and parameter names are now camelCase. Previously we used a mix of camel and snake cases
- Improves error exception handling (closes #7)
- Introduced ~2 dozen new exception types that extend from either
ApiException
orEasyPostException
- ApiExceptions will behave like the previous EasyPostException class did. They will include a
message
,errors
,code
,httpStatus
andhttpBody
. This class extends the more generic EasyPostException which only contains a message, used for exceptions thrown directly from this library - The
ecode
property of anApiException
is now justcode
- Introduced ~2 dozen new exception types that extend from either
- Functions that previously returned
true
now return void as there is no response body from the API (eg:fundWallet
,deletePaymentMethod
,updateEmail
,createList
) - Adopts
Guzzle
as the HTTP client for this library. This should provide a much more consistent experience, better encoding, and faster request times in some cases - The results of calling
allApiKeys
is no longer double wrapped with the mode of the API key (these are still accessible inside of each object) Requestor
has moved toHttp
, constants fromEasyPost
now live inConstants
,Error
moved toException
- Occurances of
smartrate
are nowsmartRate
andSmartrate
are nowSmartRate
to match the documentation and API expectations Referral
is nowReferralCustomer
to better match documentation and API expectationvalidateWebhook
,getLowestSmartRate
, andreceiveEvent
are now underEasyPost\Util\Util
as they do not make any API calls and do not need the associated client object- The
receive
function previously in the namespace ofEvent
is now calledreceiveEvent
since it has been relocated to the generic Util namespace - Internal, library only utilities have been moved to
EasyPost\Util\InternalUtil
- The
- The beta
EndShipper
class has been removed, please use the generally availableEndShipper
class - Various properties and functions that were previously intended for private/protected use but were public have been corrected
- All phpdoc type hints, descriptions, return values, and throws references were corrected or updated
- All dependencies were bumped
- Various other bug fixes and improvements were made along with addressing deprecation warnings
- Adds carrier account creation routes requests correctly for carriers that require custom workflows
- Instead of returning
null
when a list of child API keys cannot be returned (eg: when you callapi_keys
on a non-user object) it will return an empty list. The expected impact to end users is extremely low - Retrieving child user API keys for users with large numbers of child users should see much faster results as we now break on the match instead of iterating the entire list
- Adds Partner White Label (Referral) Support
- Adds ability to create a referral user
- Adds ability to update a referral user's email
- Adds ability to retrieve all referral users
- Adds ability to add a credit card to a referral user's account
- Adds support to specify an
$endShipperId
on the buy call of a Shipment - Removes unreachable code in the address verification flow that checked for the existence of an address (errors will continue to be thrown on failure)
- Moves EndShipper out of beta into the general library namespace
- Removes some extra imports that no longer exist causing errors when importing this library. Adds a regression test to protect against this in the future.
- Adds Carbon Offset support
- Adds ability to create a shipment with carbon offset
- Adds ability to buy a shipment with carbon offset
- Adds ability to one-call-buy a shipment with carbon offset
- Adds ability to rerate a shipment with carbon offset
- Adds
validateWebhook
function that returns your webhook or raises an error if there is awebhookSecret
mismatch - Fixes a bug that required the values of
verify
andverify_strict
params on an Address creation call to be arrays since passingtrue
as a boolean is also valid (passing an array will continue to work but is no longer required)
- Add ability to generate forms for shipments via
generate_form()
function
- Adds
Billing::retrieve_payment_methods()
,Billing::fund_wallet()
, andBilling::delete_payment_method()
functions - Adds OS specific details to the
User-Agent
header - Applies a patch to coerce array error messages to strings where error mapping is done improperly (as is the case with carriers like GSO/GLS) (closes #181)
- Fixes a missing parameter bug by setting the
beta
parameter in therefresh
function tofalse
by default
- Adds the
EndShipper
Beta class withcreate
,retrieve
,all
, andsave
functions
- Adds present but unimported supplemental EasyPost object classes such as
TrackingDetails
to the lib (closes #164)
- Adds a
lowest_rate()
function to Orders and Pickups - Adds
Shipment::get_lowest_smartrate()
and$shipment.lowest_smartrate()
functions - Removes the
params
from theAddress->verify()
method since it's non-static and unused - Removes dead conditional
message
check inAddress::create_and_verify
Upgrading major versions of this project? Refer to the Upgrade Guide.
- Bumped minimum PHP version supported from
5.3
to7.3
- Adds a full test suite, all functions are now tested for each object
- Adds class properties to every class (closes #96)
- Updates and adds docblocks to each function throughout the library
- Switched from
array()
syntax to[]
throughout the project - Adds the
update_brand()
method on theUser
object - Set a default timeout of 30 seconds for connections and 60 seconds for requests
- Fixes the
create_list()
Tracker andcreate_and_buy()
Batch method's encodings to properly send through the parameters - Adds the PHP version used to the
User-Agent
header - Removed unusable
all()
method on theParcel
object - Removed unpaginated
all()
method on theOrder
,CustomsInfo
, andCustomsItem
objects - Removed the
get_rates()
method on the Shipment object since a Shipment object already has rates. If you need new rates for a shipment, use theregenerate_rates()
method instead - Ignores return types for now on
ArrayAccess
andIterator
methods (closes #124) - Bumps dev dependencies
- Various other small improvements and bug fixes
- Further fixes JSON encoding by dropping null key/values, sending values as strings where necessary (returning to previous behavior), and removing the
array_filter
from the previous release
- Properly handles empty lists and objects with JSON encoding (closes #114)
Upgrading major versions of this project? Refer to the Upgrade Guide.
- JSON encodes POST bodies instead of form encoding them
- Adds TaxIdentifier support
- Corrects references of
[email protected]
to[email protected]
- Bumps patch versions of dependencies
- Adds
SmartRate
functionality to theShipments
object (available by callingget_smartrates()
on a shipment)
- Added event retrieval methods
- Fixed a bug that did not allow carrier accounts to be deleted
- Fixed a bug that did not allow users to be deleted
- Removed various pieces of old code
- Added "Refund" and "Shipment Invoice" to the prefix and type lists
- Version bump with updated author
- Bumped version in package.json for Packagist
- Updated README with release instructions
- Fixed a bug that would not create reports properly
- Added unit tests for reports
- Added ability to set connection and response timeouts for all EasyPost actions (thanks mattjanssen!)
- Renamed
Object
classEasyPostObject
since Object is a keyword in PHP7.2
- Fixed confusing Pickup example
- Enabled Reports to retrieve without a type parameter
- Use X-Client-User-Agent over X-EasyPost-Client-User-Agent
- Added get_rates method to Order objects
- Fixed compatibility issues with older PHP versions and the Report class
- Fixed Create for ScanForms
- Added basic CRUD methods for Webhooks
- Fixed error in Util.php they may have affected shipment_reports retrievals
- Added ability to create Report objects for shipment, tracker and payment_log reports
- Fixed warning message from Address Verify/VerifyStrict
- Added create_list for trackers
- Added Insurance support
- Renamed "Resource" class to "EasypostResource" since Resource is reserved in PHP7 (thanks ccovey!)
- Added ability to create top-level users
- Added 'verify' and 'verify_strict' options to Address creation
- Updated ReadMe (thanks browner12!)
- Added DocBlock annotations to all methods (thanks browner12!)
- Fixed Shipment Retrieve by tracking_code
- Added Tracker.all example, and updated some old examples
- Removed cURL options for SSL version, timeout, and connect timeout. The default values for these options are acceptable.
- Added User and CarrierAccount resources and examples for each.
- Modified EasyPost Object setter to record the change in the top level parent object rather than the object that the change was made in. This allows you to change sub objects and then call save() on the parent to have all properties saved.
- Removed EasyPost Object transientValues and made unsavedValues act as a representation of the params to send on save, rather than a flag to indicate if a property had been changed.
- Added support for EasyPost's new error format: {"error": {"message": "...", "code": ..., "errors": {...}}} as well as a prettyPrint function to better display errors in development.
- Added support for additional HTTP methods PATCH and PUT.
- EasyPost Objects are now Iterable.
- Added pickup class
- Added pickup example
- Added tracker to shipment buy response
- Updated tracker examples
- Added Item, Container, and Order resources.
- Updated the CA cert bundle.
- Added the ability to add negative filters to Shipment->lowest_rate by starting them with an exclamation mark.
- Added endpoint to create shipment from tracking code.
- Added Event resource for webhooks.
- API Addition: Batch.buy method added. Trigger the purchasing of labels after a successful Batch.create.
- API Addition: Batch.scan_form method added. Quickly generate a scan_form for an entire batch.
- API Addition: Tracker objects added. Trackers can be used to register any tracking code with EasyPost webhooks.
- Bug fix: error messages should no longer be truncated to their first character.
- Added function to Address to all creating and verifying at the same time.
- Add label function to Shipment to request specific label file_formats (pdf, epl2, zpl).
- Add insure function to Shipment. Add insurance to any shipment in one call!