- Removes the deprecated
create_list
tracker endpoint function as it is no longer available via API - Fix invalid TypeScript definition for Shipment
buy
function
- Fixes webhook validation when the
weight
field contains a float by converting it back into a float after conversion from a string (closes #467)
- Adds missing properties to
Rate
modeldelivery_date
est_delivery_days
- Fixes
getNextPage
function in User Service
- 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
- Removes the unusable CarbonOffset types
- Fix payment method funding and deletion failures due to undetermined payment method type
- Adds
refund
function in Insurance service for requesting a refund of standalone insurance.
- Adds missing exports to Typescript definitions (ApiKey, Billing, Brand, EndShipper, Fee, PaymentMethod, Rate, Refund) - closes #433
- Adds
allChildren
function in User service to get a paginated list of children - Adds
getNextPage
function in User service to get next paginated list of children
- Removes
withCarbonOffset
parameter from shipment create and buy functions - Removes
carbon_offset
property ofRate
object - Fixes a pagination issue by passing along additional params used when fetching first page
- Removes
createAndBuy
function fromBatch
service (deprecated endpoint server-side) - Removes the
beta_carrier_metadata
service as it is deprecated, please use thecarrier_metadata
GA service instead
- Bump all dependencies to address security vulnerabilities in Babel
- Fixes a bug causing
ScanForm
creation to fail
- Adds
apiKeys
method toUser
service allowing you to retrieve parent or child API keys by user ID - Adds all possible
ITrackerStatusDetail
values to the Typescript definitions
- Fix endpoint for creating a FedEx Smartpost carrier account
- Corrects the Typescript definition for
lowestRate
of Shipment, Order, and Pickup objects
- Checks for
X-Hmac-Signature
header during webhook validation regardless of casing (closes #399)
- Adds methods to the easypost client for subscribing and unsubscribing from requests and responses being sent to the API
addRequestHook
: Adds a request hook to the EasyPost client. Useful for logging or debugging.removeRequestHook
: Removes a request hook from the EasyPost client.clearRequestHooks
: Clears all request hooks from the EasyPost client.addResponseHook
: Adds a response hook to the EasyPost client. Useful for logging or debugging.removeResponseHook
: Removes a response hook from the EasyPost client.clearResponseHooks
: Clears all response hooks from the EasyPost client.
- Maps 400 status codes to new
BadRequestError
class
- Fixes the
pickup_rates
Typescript property of a Pickup
- Retrieving carrier metadata is now generally available via
client.carrierMetadata.retrieve
- Bumps and modernizes all dependencies which no longer requires a force install/update
- Adds support for Typescript 5
- Typescript definitions graduated from beta to GA
- Adds missing typescript definitions for
Utility
class - Fixes incorrect typescript definitions for
Address
,EndShipper
andWebhook
class methods - Moves
Utils
to EasyPostClient class
- Adds
retrieveEstimatedDeliveryDate
in Shipment service
- Fixes the Beta client, previously the beta functions were not accessible due to how they were exported. This has now changed so each service is prepended with
Beta
(eg:BetaCarrierMetadata
) - Adds
CarrierMetadata
typescript definitions
- Adds beta
retrieveCarrierMetadata
function - Adds missing
api_keys
property toUser
- Improves Error Deserialization to dynamically handle edge cases that have a bad format
- Adds a helper function to retrieve carrier metadata
- Add
getNextPage
function that retrieves the next page of results for a paginated collection
Includes all of the changes made in v6.0.0-rc1 below plus the following:
- Adds class properties to each model for autocomplete and explicit deserialization
- Adds missing
status_detail
to trackers
- Bumps minimum Node from 10 to 12
- Renamed default export
API
toEasyPostClient
- Overhauled the data flow of the library
- Instead of creating a local object and then calling
.save()
on it to create/update it at the API level, you will pass in the same data as before but to one of eithercreate()
orupdate()
functions on the service in question - The base service no longer implements all functions and instead each individual service implements its own functions. This means the library namespace won't be cluttered with various
notImplemented
functions - All instance functions (excluding
lowestRate
) previously called on an object are instead called on a service. (eg:shipment.buy(shipment.lowest_rate())
is nowclient.Shipment.buy(shipment.id, shipment.lowest_rate())
))- All functions attached to a service are now async and must be awaited
- Instead of creating a local object and then calling
- Moved library structure around
- Introduced
/models
that contain the EasyPost objects - Renamed
/resources
to/services
to better reflect that a service called against an EasyPostClient differs from an API resource, now known as themodels
- Each service file now has
_service
appended - Added
/utils
which contains bothinternal_util.js
which is not intended for user consumption andutil.js
which contains public utilities - Moved
getLowestSmartRate
andvalidateWebook
function toutil.js
as neither of them require the client object to function
- Introduced
- References of
Referral
were changed toReferralCustomer
to match the API - Bumps major versions of all dependencies
- Changes the
primaryOrSecondary
parameter name topriority
in billing functions to match the API - Empty response functions now return nothing (deleting records, funding a wallet, etc)
- Explicit
type
parameter for retrieving all reports removed, includetype
in genericparams
dictionary instead. - Improves error handling
- Specific error types for each category of error
- API error message may be an array rather than a string. Arrays will be concatenated (by comma) and returned as a string.
- Corrects references of
smartrate
toSmartRate
andsmartRate
to match the API
- Add
retrieveStatelessRates
andgetLowestStatelessRate
functions
- Completely overhauled deserialization process, nested objects (eg: rates of shipments, etc) now properly convert to their appropriate EasyPostObject
- Fixes the
verifyAddress
function to actually verify an address - Fixes a bug that could double wrap or unintentionally wrap the results of an
/all
API call with the name of the object in question
- Adds
all
function toPickup
class to retrieve all pickups - Adds
retrievePayload
andretrieveAllPayloads
functions to retrieve payloads for an Event- These are static functions on the Event class, so you can call them like
easypost.Event.retrieveAllPayloads(eventId)
- These are static functions on the Event class, so you can call them like
- Adds missing Typescript implementations for
CustomsInfo
,CustomsItem
,ScanForm
,User
,Referral
,Rate
,CarbonOffset
, andBrand
(closes #328)
- Adds new beta billing functionality for ReferralCustomer users
addPaymentMethod
can add a pre-existing Stripe bank account or credit card to your EasyPost accountrefundByAmount
refunds your wallet by a dollar amountrefundByPaymentLog
refunds you wallet by a PaymentLog ID
- Routes requests for creating a carrier account with a custom workflow (eg: FedEx, UPS) to the correct endpoint when using the
save
function
- Fixes multiple bugs that made the
addCreditCard
function unusable, adds tests - The response of the
updateBrand
function now properly becomes aBrand
object - Insuring a shipment via
Shipment.insure
no longer improperly wraps theamount
key inid
. There may be other edge cases among other object/function calls that get corrected due to this change - Validating webhook signatures of differing byte sizes now throws a more meaningful error message
- Removed the browser check when building request headers. Impact should be minimal since out of the box this library cannot be used in the browser
- Adds support to pass an
EndShipper
ID to the shipment buy call - Migrates the Partner White Label (Referral) functions from beta to the general library namespace and deprecates the beta functions
- Fixes a regression introduced in v5.1.0 that included the entire response instead of the response body when errors are returned from the API
- Corrects the error type when Stripe cannot be reached when adding a credit card for referral users
- Moves EndShipper out of beta to the general library namespace
- Adds Carbon Offset support
- Adds the ability to create a shipment with carbon_offset
- Adds the ability to buy a shipment with carbon_offset
- Adds the ability to one-call-buy a shipment with carbon_offset
- Adds the ability to regenerate a shipment with carbon_offset
- Adds
validateWebhook
function that returns your webhook or raises an error if there is awebhookSecret
mismatch - Allows for looser values to the
verify
andverify_strict
params when creating an address (can accept strings or bools outside of an array)
- Adds the ability to generate shipment forms via
Shipment.generateForm()
function - Adds missing Typescript definitions for Billing and PaymentMethod
- Adds bundled Typescript definitions in beta (closes #119, #122, #184, and #243 - big thank you to our awesome community!)
- Adds
Billing.retrievePaymentMethods()
,Billing.deletePaymentMethod()
, andBilling.fundWallet()
functions - Adds support for webhook secrets
- Adds OS-specific details to the user-agent header
- Swaps update functions from
put
topatch
to better match API expectation and documentation. Behavior of these functions should remain the same
- Adds the
EndShipper
Beta class withsave()
,retrieve()
, andall()
functions - Bumps patch versions of dependencies
- Adds a
lowestRate()
function to Orders and Pickups - Adds a
Shipment.getLowestSmartrate()
andshipment.lowest_smartrate()
functions - Adds an error message to
lowestRate()
functions when no lowest rate can be found - Adds beta Referral class for the new Partner White Label API with these new functions:
create()
,update_email()
,all()
, andadd_credit_card()
- Fixes API error parsing by first trying to additional error message fields before falling back to the current configured fields
- Bumps the minimum version of Node to
v10
- Removes build targets of
0.10
,6
, and8
, the library is now only published under a single bundledeasypost
package instead of separate bundled assets per version - Bumps all dependencies to the most recent compatible versions that still support Node 10, the library is now buildable on Node 16+
- Removed
retrieveRates()
method because the shipment object already has rates. If you need to get new rates for a shipment, please use regenerateRates() method instead - Removed
enable()
anddisable()
methods in the apiKey class. Please use this functionality through EasyPost website - Removed the deprecated
options.useCookie
param. Please useoptions.useProxy
instead - Removed
add_shipment
andremove_shipment
from the Batch object which could lead to confusion as the API documentation only describes adding/removing as an array. If you need to add or remove a single shipment from a batch, use the already existingadd_shipments
andremove_shipments
and pass your single shipment into an array. - The responses from the
/all
endpoints are no longer unwrapped and now properly follow the documentation where records will be wrapped in their respective object key- This now corrects the location of the
has_more
key which allows for pagination
- This now corrects the location of the
- Adds support to one-call buy an order
- Adds the Nodejs version in use to the User-Agent header on requests
- Adds support to update the brand for a user
- Adds
retrieveMe()
convenience function that retrieves the authenticated user without the need to specify an ID - Adds
address.verifyAddress()
andAddress.createAndVerify()
functions - Adds
Batch.createAndBuy()
function - Adds
Refund
class which hasRefund.save()
,Refund.all()
, andRefund.retrieve()
functions
- Fixes
delivery_date
property typo on Rate object - Fixes
customs_item.value
to be anumber
instead of astring
- Lowered the default timeout of requests from 120 seconds to 60 seconds
- Removes
@easypost/build
and instead uses Webpack directly to build the project- The project is now only built for
node
and may not provide browser compatible code. If you require browser compatible Javascript, we suggest you build from source
- The project is now only built for
- Adds
prettier
and formats the entire project - Adds comprehensive test suite with Pollyjs covering every interface of the client library
- Adds jsdoc style info to each method
- JSON encodes POST bodies instead of form encoding them by default
- Adds support for
tax_identifiers
- The
regenerateRates
method now makes a post request to re-rate a shipment. The newretrieveRates
will simply retrieve the rates of a shipment without re-rating - Ran
npm audit fix
to bump patch versions of dependencies
- Corrects the
usps_zone
propType from integer to number
- Re-package to fix missing file
- add "prepublishOnly" script and ignore all build assets (#177)
- docs: adds info about built docs to README
- Adds
SmartRate
functionality to theShipments
object (available by callinggetSmartrates()
on a shipment) - Adds missing
declaration
andrestriction_comments
propTypes to the customsInfo object - Changes the
usps_zone
propType from a string to an integer to match what is returned from the API - Bumped dependencies
- Re-package to fix missing file
- Added events methods
- Added various code examples
- Added rate object
- Removed various old code
- Updated tests
- Restored support for Node 6.x
- Bumped many dependencies
- Swapped out Travis CI for GitHub Actions
- Bump
websocket-extensions
to 0.1.4
- Added the ability to retrieve individual user's API keys
- Added the ability to retrieve all address records
- Removed the unusable shipment return method
- Security updates to Node modules
- Swapped link for Travis CI from .org to .com
- Updated stale unit tests
- Added Insurance object support
- Added an optional timeout for requests. Defaults to 120000ms (thanks Shyp and misterMuyiwa!)
- Added Orders
- Fixed some bad tests (Addresses, Shipments, Parcels)
- Added "verify" and "verify_strict" options to Address create, and made tests for them.
- Updated README and tests
- Changed shipment rate request to use GET not POST
- Fixed some tests
- Added ability to buy and cancel pickups
- Added tracker to shipment buy response
- Added User-Agent fields to request header
- Updated tests
- Moved vows module to a devDependancy.
- Fixed some bugs and improved Shipment.lowestRate by allowing negative filters.
- Improved handling of the partial shipment response object that Shipment.buy returns.
- Minor syntax and documentation improvements.
- Event resource added for webhook consumption.
- Tracker resource added.
- Batch.create_scan_form added to request a ScanForm containing all of a Batch's shipments.
- Added label function to Shipment to request specific label file_formats (pdf, epl2, zpl).
- Added insure function to Shipment. Add insurance to any shipment in one call!
- Added create_and_verify function to Address.