- Adds
IAddressVerificationFieldErrorTypescript interface, replacingIFieldErroronVerification - Adds missing
suggestionproperty toIFieldError - Removes unused dependencies, bumps remaining
- Adds generic
makeApiCallfunction
- Adds the following functions:
FedExRegistration.registerAddressFedExRegistration.requestPinFedExRegistration.validatePinFedExRegistration.submitInvoice
- Corrects additional Typescript definitions (eg: reference to
RateonShipment,Claimmissingreference)- Adds automated testing to catch Typescript errors in the future
- Bumps dependencies
- Adds the following functions usable by child and referral customer users:
ApiKey.createApiKey.deleteApiKey.enableApiKey.disable
- Adds a
Tracker.deletefunction - Fixes various Typescript definitions (adding missing items, correcting invalid items, consolidating duplicates, etc)
- Fixes TypeScript exports for model classes to be type-only exports. This prevents runtime errors when attempting to use these classes with
instanceofor as constructors, since they are not actually exported as JavaScript values from the package. Users can still use these types for type annotations. (closes #456)
- Fixes TypeScript exports for model classes to be type-only exports. This prevents runtime errors when attempting to use these classes with
- Adds the following functions:
Embeddable.createSessionCustomerPortal.createAccountLink
- Bumps dependencies
- Adds support for
UspsShipAccount - Adds
Tracker.retrieveBatchfunction - Adds
verify_carrieraddress param
- Adds the following functions
Shipment.createAndBuyLumaShipment.buyLumaLuma.getPromise
- Adds
referenceandrecipient_nameto Claims
- Corrects the endpoint used for creating/updating UPS accounts
- Fixes built distribution by removing reference to removed
repl
See our Upgrade Guide for more details.
- Drop support for Node 12, 13, 14, and 15
- Adds
webhook_secretandcustom_headersproperties to Typescript definitions of a Webhook - Adds the following functions to assist ReferralCustomers add credit cards and bank accounts:
betaReferralCustomer.createCreditCardClientSecretbetaReferralCustomer.createBankAccountClientSecretreferralCustomer.addCreditCardFromStripereferralCustomer.addBankAccountFromStripe
- Adds missing tracker props
- Routes
AmazonShippingAccountto the correct endpoint on create - Fixes all references to the docs
- Properly returns the response body of the following functions:
addPaymentMethod,refundByAmount,refundByPaymentLog findMatchingMockRequestmocking function made private- Removes undocumented and unmaintained
repl - Bumps dependencies
- Fixes type importing and constructor creation (closes #446)
- Replaces Webpack with Vite for building the distributable library
- Fixes the filename for the
AddressCreateParameterstype declaration file (closes #487) - Bumps dependencies
- Removes the deprecated
create_listtracker endpoint function as it is no longer available via API - Fix invalid TypeScript definition for Shipment
buyfunction
- Fixes webhook validation when the
weightfield contains a float by converting it back into a float after conversion from a string (closes #467)
- Adds missing properties to
Ratemodeldelivery_dateest_delivery_days
- Fixes
getNextPagefunction in User Service
- Adds new
Claimservice for filing claims on EasyPost shipments and insurances
- Adds new
Shipment.recommendShipDate,SmartRate.recommendShipDate, andSmartRate.estimateDeliveryDatefunctions - Routes
UpsAccount,UpsMailInnovationsAccount, andUpsSurepostAccountcreate/update requests to the new/ups_oauth_registrationsendpoint- 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
refundfunction 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
allChildrenfunction in User service to get a paginated list of children - Adds
getNextPagefunction in User service to get next paginated list of children
See our Upgrade Guide for more details.
- Removes
withCarbonOffsetparameter from shipment create and buy functions - Removes
carbon_offsetproperty ofRateobject - Fixes a pagination issue by passing along additional params used when fetching first page
- Removes
createAndBuyfunction fromBatchservice (deprecated endpoint server-side) - Removes the
beta_carrier_metadataservice as it is deprecated, please use thecarrier_metadataGA service instead
- Bump all dependencies to address security vulnerabilities in Babel
- Fixes a bug causing
ScanFormcreation to fail
- Adds
apiKeysmethod toUserservice allowing you to retrieve parent or child API keys by user ID - Adds all possible
ITrackerStatusDetailvalues to the Typescript definitions
- Fix endpoint for creating a FedEx Smartpost carrier account
- Corrects the Typescript definition for
lowestRateof Shipment, Order, and Pickup objects
- Checks for
X-Hmac-Signatureheader 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
BadRequestErrorclass
- Fixes the
pickup_ratesTypescript 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
Utilityclass - Fixes incorrect typescript definitions for
Address,EndShipperandWebhookclass methods - Moves
Utilsto EasyPostClient class
- Adds
retrieveEstimatedDeliveryDatein 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
CarrierMetadatatypescript definitions
- Adds beta
retrieveCarrierMetadatafunction - Adds missing
api_keysproperty toUser - Improves Error Deserialization to dynamically handle edge cases that have a bad format
- Adds a helper function to retrieve carrier metadata
- Add
getNextPagefunction that retrieves the next page of results for a paginated collection
See our Upgrade Guide for more details.
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_detailto trackers
- Bumps minimum Node from 10 to 12
- Renamed default export
APItoEasyPostClient - 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
notImplementedfunctions - 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
/modelsthat contain the EasyPost objects - Renamed
/resourcesto/servicesto better reflect that a service called against an EasyPostClient differs from an API resource, now known as themodels - Each service file now has
_serviceappended - Added
/utilswhich contains bothinternal_util.jswhich is not intended for user consumption andutil.jswhich contains public utilities - Moved
getLowestSmartRateandvalidateWebookfunction toutil.jsas neither of them require the client object to function
- Introduced
- References of
Referralwere changed toReferralCustomerto match the API - Bumps major versions of all dependencies
- Changes the
primaryOrSecondaryparameter name topriorityin billing functions to match the API - Empty response functions now return nothing (deleting records, funding a wallet, etc)
- Explicit
typeparameter for retrieving all reports removed, includetypein genericparamsdictionary 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
smartratetoSmartRateandsmartRateto match the API
- Add
retrieveStatelessRatesandgetLowestStatelessRatefunctions
- Completely overhauled deserialization process, nested objects (eg: rates of shipments, etc) now properly convert to their appropriate EasyPostObject
- Fixes the
verifyAddressfunction to actually verify an address - Fixes a bug that could double wrap or unintentionally wrap the results of an
/allAPI call with the name of the object in question
- Adds
allfunction toPickupclass to retrieve all pickups - Adds
retrievePayloadandretrieveAllPayloadsfunctions 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
addPaymentMethodcan add a pre-existing Stripe bank account or credit card to your EasyPost accountrefundByAmountrefunds your wallet by a dollar amountrefundByPaymentLogrefunds 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
savefunction
- Fixes multiple bugs that made the
addCreditCardfunction unusable, adds tests - The response of the
updateBrandfunction now properly becomes aBrandobject - Insuring a shipment via
Shipment.insureno longer improperly wraps theamountkey 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
EndShipperID 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
validateWebhookfunction that returns your webhook or raises an error if there is awebhookSecretmismatch - Allows for looser values to the
verifyandverify_strictparams 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
puttopatchto better match API expectation and documentation. Behavior of these functions should remain the same
- Adds the
EndShipperBeta 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
See our Upgrade Guide for more details.
- 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 bundledeasypostpackage 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.useCookieparam. Please useoptions.useProxyinstead - Removed
add_shipmentandremove_shipmentfrom 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_shipmentsandremove_shipmentsand pass your single shipment into an array. - The responses from the
/allendpoints 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_morekey 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
Refundclass which hasRefund.save(),Refund.all(), andRefund.retrieve()functions
- Fixes
delivery_dateproperty typo on Rate object - Fixes
customs_item.valueto be anumberinstead of astring - Lowered the default timeout of requests from 120 seconds to 60 seconds
- Removes
@easypost/buildand instead uses Webpack directly to build the project- The project is now only built for
nodeand 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
prettierand formats the entire project - Adds comprehensive test suite with Pollyjs covering every interface of the client library
- Adds jsdoc style info to each method
See our Upgrade Guide for more details.
- JSON encodes POST bodies instead of form encoding them by default
- Adds support for
tax_identifiers - The
regenerateRatesmethod now makes a post request to re-rate a shipment. The newretrieveRateswill simply retrieve the rates of a shipment without re-rating - Ran
npm audit fixto bump patch versions of dependencies
- Corrects the
usps_zonepropType 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
SmartRatefunctionality to theShipmentsobject (available by callinggetSmartrates()on a shipment) - Adds missing
declarationandrestriction_commentspropTypes to the customsInfo object - Changes the
usps_zonepropType 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-extensionsto 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.