- Removes the deprecated
create_list
tracker endpoint function as it is no longer available via API
- Add improved inheritance tree for error types, allowing end-user to properly cast and check for specific error types and sub-types
- Update HTTP logic to use query for GET/DELETE requests and body for POST/PUT/PATCH requests
- Fix parameters for retrieving next page of child users
- Add new claim-related functions:
CreateClaim
,GetClaim
,ListClaims
,GetNextClaimPage
andCancelClaim
- Adds new
EstimateDeliveryDateForZipPair
,RecommendShipDateForShipment
andRecommendShipDateForZipPair
- New
CreateUpsCarrierAccount
andUpdateUpsCarrierAccount
methods and associated parameter structs, required to use for UPS accounts due to 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. - Attempting to use the generic
CreateCarrierAccount
andUpdateCarrierAccount
methods with UPS accounts will throw anInvalidFunctionError
.
- Starting
- Adds missing
Readable
andLogo
fields toCarrierType
struct
- Adds
ContentDescription
,DropoffMaxDatetime
, andPickupMaxDatetime
shipment options
- Fix payment method funding and deletion failures due to undetermined payment method type
- Adds
RefundInsurance
function in Insurance service for requesting a refund for a standalone insurance
- Fix
DateTime
-type parameters not being included in GET requests
- Add
ListChildUsers
andGetNextChildUserPage
functions toUser
service
- Removes the undocumented
CreateAndBuy
function from the Batch service. The proper usage is to create a batch first and buy it separately - Removed
CarbonOffset
parameter fromcreateShipmentRequest
,buyShipmentRequest
, andbuyShipmentRequest
structs as EasyPost now offers Carbon Neutral shipments by default for free
- Add
GetAPIKeysForUser
under API Key service to retrieve API keys for a specific user ID
- Adds
CommercialInvoiceSignature
andCommercialInvoiceLetterhead
shipment options
- Fix endpoint for creating a FedEx Smartpost carrier account
- Drop support for Go 1.15
- Minimum supported version is now Go 1.16
- Adds specific error types for API and local errors
- All errors inherit the
LibraryError
interface- API errors inherit the
APIError
interface, which inherits theLibraryError
interface - Local errors inherit the
LocalError
interface, which inherits theLibraryError
interface
- API errors inherit the
- Common error messages are now available as constants for parsing (e.g. regex)
- All errors inherit the
- All uses of
*time.Time
have been replaced with neweasypost.DateTime
classDateTime
is a wrapper aroundtime.Time
that handles unexpected date formats from the API
- Previously-marked deprecated functions and structs have been removed:
ListReportOptions
struct -> useListOptions
struct instead- Beta carrier metadata functions -> use non-beta functions instead
LowestRate
shipment functions -> useLowestShipmentRate
functions insteadCreateWebhook
function -> useCreateWebhookWithDetails
function insteadEnableWebhook
function -> useUpdateWebhook
function instead
TrackingCodes
string array onListTrackersOptions
struct is nowTrackingCode
single stringAddShipmentsToBatch
andRemoveShipmentsFromBatch
functions now explicitly acceptShipment
structs instead of genericinterface{}
types- Functions will no longer accept solely IDs; users will need to provide whole
Shipment
structs
- Functions will no longer accept solely IDs; users will need to provide whole
- Adds hooks to introspect the request and response of an API call (see
HTTP Hooks
section of the README for more information)
- Migrates Carrier Metadata to GA (now available via
GetCarrierMetadata
)
- Adds
GetShipmentEstimatedDeliveryDate
andGetShipmentEstimatedDeliveryDateWithContext
functions
- Adds
SuppressETD
toShipmentOptions
- Adds missing
CustomsInfo
to the Order struct
- Adds
BetaGetCarrierMetadata
,BetaGetCarrierMetadataWithCarriers
,BetaGetCarrierMetadataWithTypes
, andBetaGetCarrierMetadataWithCarriersAndTypes
function - The
Message
attribute of anAPIError
is now aninterface{}
rather than astring
, due to potential inconsistent data structure from the API response- Behind-the-scenes, the
message
portion of the JSON response is transformed to a concatenated string. Users should be able to safely cast theMessage
attribute to a string when accessing it viamyApiError.Message.(string)
- Behind-the-scenes, the
- Adds
GetNextXPage
functions (e.g.GetNextShipmentPage
) to retrieve the next page of results for a provided paginated list
- Adds missing
StatusDetail
property toTracker
andTrackingDetail
structs - Removes unusable
FullTestTracker
field fromCreateTrackerOptions
- Adds
StatelessRate
object struct,BetaGetStatelessRates
function to get ephemeral rates. - Adds
LowestStatelessRate
,LowestStatelessRateWithCarrier
andLowestStatelessRateWithCarrierAndService
functions to get the lowest stateless rate from a list of stateless rates.
- Adds function to retrieve a specific payload for a specific event,
GetEventPayload
- Adds
ListPickups
function toPickup
to retrieve all pickups
- Removes
BetaAddPaymentMethodWithPrimaryOrSecondary
and adds theprimaryOrSecondary
parameter from that function to theBetaAddPaymentMethod
function which was the initial intention
- Adds new beta billing functionality for ReferralCustomer users
BetaAddPaymentMethod
can add a pre-existing Stripe bank account or credit card to your EasyPost accountBetaRefundByAmount
refunds your wallet by a dollar amountBetaRefundByPaymentLog
refunds you wallet by a PaymentLog ID
- Adds new
PickupMinDatetime
andDeliveryMaxDatetime
Shipment options
- Routes requests for creating a carrier account with a custom workflow (eg: FedEx, UPS) to the correct endpoint when using the
CreateCarrierAccount
function
- Adds
LabelSize
shipment option
- Adds
EndShipperID
shipment option - Adds support to pass an
EndShipperID
when buying a shipment - Adds White Label support:
- Create a referral customer
- Update a referral customer's email address
- List all referral customers
- Add a credit card to a referral customer's account
- Adds
CreateEndShipper()
,GetEndShipper()
,ListEndShippers()
, andUpdateEndShippers()
functions - Adds
duty_payment
andduty_payment_account
to Shipment options
- 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 re-rate a shipment with carbon offset
- Adds
ValidateWebhook
function that returns your webhook or raises an error if there is awebhook_secret
mismatch
- Add support for generating shipment forms via
GenerateShipmentForm
function
- Adds
RetrievePaymentMethods
,FundWallet
andDeletePaymentMethod
functions - Adds
BillingType
in CarrierAccount and Rate structs - Adds new lowest rate functions for Shipments, Orders and Pickups
- Adds new lowest smartrate functions for Shipments
- Adds OS details to the User-Agent header
- Adds support for webhook secrets
- Update methods now use
patch
instead ofput
behind the scenes to better match the API expectation and documentation. Update functions should still behave the same as before - Enforces passing an API key on each request (the library will now fail fast instead of sending an impossible-to-service HTTP request)
- Adds
Columns
andAdditionalColumns
params toReport
struct - Adds
Declaration
attribute inCustomsInfo
struct
- Adds missing
CreateAndVerifyAddress
andCreateAndVerifyAddressWithContext
functions
- Adds
CreateRefund
,CreateRefundWithContext
,ListRefunds
,ListRefundsWithContext
,GetRefund
, andGetRefundWithContext
in the Refund file - Adds missing
ID
attribute toBrand
struct - Fixes a bug where the
AddShipmentsToBatch
, andAddShipmentsToBatchWithContext
functions wouldn't allow a Shipment object to be passed by changing the params fromstring
tointerface{}
- Fixes a bug where the
RemoveShipmentsFromBatch
, andRemoveShipmentsFromBatchWithContext
functions wouldn't allow a Shipment IDs to be passed by changing the params from*Shipment
tointerface{}
- Fixes the return type of
ListBatchesResult
frombatch
toinsurance
- Fixes the HTTP method from
GET
toPOST
forGetBatchLabels
andGetBatchLabelsWithContext
- Adds comprehensive test coverage
- Corrects namespace for v2 release from
github.com/EasyPost/easypost-go
togithub.com/EasyPost/easypost-go/v2
NOTE: Do not use this release, use v2.0.1 or later due to this release being incorrectly packaged.
Upgrading major versions of this project? Refer to the Upgrade Guide.
- Bumps minimum Go version from
1.12
to1.15
- Bumps dependencies
- Lints the entire project
- adds a
client.RetrieveMe()
function to retrieve the authenticated user - Adds support to one-call buy an order by passing a
Service
andCarrierAccount
- Adds support to update user brand via
client.UpdateBrand()
- Adds support to create a list of trackers via
client.CreateTrackerList()
- Adds support for getting the lowest rate of a shipment via
client.LowestRate()
- Adds support to rerate a shipment via the
client.RerateShipment()
method - Adds a default timeout of 60 seconds to requests. This can be overridden by setting the
Client.Timeout
option in milliseconds - Fixed a spelling error for
origin_location
on the Tracker struct - Removed
GetShipmentRates()
andGetShipmentRatesWithContext()
methods since the shipment struct already has rates. If you need to get new rates for a shipment, please use theRerateShipment()
method instead - Adds a
SmartRate
struct since the structure of theRate
andSmartRate
objects are different (previously the SmartRate object borrowed the Rate struct)
- Adds support for
TaxIdentifiers
- Remove experimental undocumented methods
ListTrackersUpdated
andListTrackersUpdatedWithContext
- Corrects
CODAmount
from afloat64
to astring
- Adds
Smartrate
functionality to theShipments
object (available by callingGetShipmentSmartrates()
)
- Fix batch scan form functionality; replace GetBatchScanForms with CreateBatchScanForms
- Update example code.
- Add GetRate method and example.
- Remove ListCustomsInfos, ListCustomsItems, ListOrders and ListPickups methods.
- Add GetEvent, ListEvents and ListEventPayloads methods. Add example code for using these methods as well as using the Event type in a webhook handler.
- Fix issue in List actions that take query parameters
- Add shipment options for certified and registered mail.
- Changes to unit tests.
- Update URL in installation instructions.
- Properly format the carrier_accounts parameter in create shipment requests. Prior to this change, specifying a carrier account would result in a failed request. This removes the undocumented parameter from the CreateShipment and CreateShipmentWithContext methods, and adds a CarrierAccountIDs field to the Shipment struct type.
- Add proper struct tag to CarrierAccount.Fields so that it has the proper key name when serialized to JSON. Prior to this change, values in the Fields field were not recognized by the API.
- Initial release.