Documentation
¶
Index ¶
- Constants
- Variables
- func BoolPtr(b bool) *bool
- func BuildErrorFromResponse(response *http.Response) error
- func StringPtr(s string) *string
- func UnmarshalJSONObject(data []byte) (interface{}, error)
- type APIError
- type APIKey
- type APIKeys
- type Address
- type AddressVerification
- type AddressVerificationDetails
- type AddressVerificationFieldError
- type AddressVerifications
- type AddressVerifyResponse
- type AiResults
- type BadRequestError
- type Batch
- type BatchStatus
- type BetaPaymentRefund
- type Brand
- type CarrierAccount
- type CarrierField
- type CarrierFields
- type CarrierMessage
- type CarrierMetadata
- type CarrierType
- type Claim
- type ClaimHistoryEntry
- type Client
- func (c *Client) AddReferralCustomerBankAccountFromStripe(referralCustomerApiKey string, paymentMethodId string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddReferralCustomerBankAccountFromStripeWithContext(ctx context.Context, referralCustomerApiKey string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddReferralCustomerCreditCard(referralCustomerApiKey string, creditCardOptions *CreditCardOptions, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddReferralCustomerCreditCardFromStripe(referralCustomerApiKey string, paymentMethodId string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddReferralCustomerCreditCardFromStripeWithContext(ctx context.Context, referralCustomerApiKey string, paymentMethodId string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddReferralCustomerCreditCardWithContext(ctx context.Context, referralCustomerApiKey string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) AddShipmentsToBatch(batchID string, shipments ...*Shipment) (out *Batch, err error)
- func (c *Client) AddShipmentsToBatchWithContext(ctx context.Context, batchID string, shipments ...*Shipment) (out *Batch, err error)
- func (c *Client) BetaAddPaymentMethod(stripeCustomerId string, paymentMethodReference string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) BetaAddPaymentMethodWithContext(ctx context.Context, stripeCustomerId string, paymentMethodReference string, ...) (out *PaymentMethodObject, err error)
- func (c *Client) BetaCreateBankAccountClientSecret() (out *clientSecretResponse, err error)
- func (c *Client) BetaCreateBankAccountClientSecretWithContext(ctx context.Context) (out *clientSecretResponse, err error)
- func (c *Client) BetaCreateBankAccountClientSecretWithReturlUrl(returnUrl string) (out *clientSecretResponse, err error)
- func (c *Client) BetaCreateBankAccountClientSecretWithReturnUrlWithContext(ctx context.Context, returnUrl string) (out *clientSecretResponse, err error)
- func (c *Client) BetaCreateCreditCardClientSecret() (out *clientSecretResponse, err error)
- func (c *Client) BetaCreateCreditCardClientSecretWithContext(ctx context.Context) (out *clientSecretResponse, err error)
- func (c *Client) BetaGetStatelessRates(in *Shipment) (out []*StatelessRate, err error)
- func (c *Client) BetaGetStatelessRatesWithContext(ctx context.Context, in *Shipment) (out []*StatelessRate, err error)
- func (c *Client) BetaRefundByAmount(refundAmount int) (out *BetaPaymentRefund, err error)
- func (c *Client) BetaRefundByAmountWithContext(ctx context.Context, refundAmount int) (out *BetaPaymentRefund, err error)
- func (c *Client) BetaRefundByPaymentLog(paymentLogId string) (out *BetaPaymentRefund, err error)
- func (c *Client) BetaRefundByPaymentLogWithContext(ctx context.Context, paymentLogId string) (out *BetaPaymentRefund, err error)
- func (c *Client) BuyBatch(batchID string) (out *Batch, err error)
- func (c *Client) BuyBatchWithContext(ctx context.Context, batchID string) (out *Batch, err error)
- func (c *Client) BuyLumaShipment(shipmentID string, in *LumaRequest) (out *Shipment, err error)
- func (c *Client) BuyLumaShipmentWithContext(ctx context.Context, shipmentID string, in *LumaRequest) (out *Shipment, err error)
- func (c *Client) BuyOrder(orderID, carrier, service string) (out *Order, err error)
- func (c *Client) BuyOrderWithContext(ctx context.Context, orderID, carrier, service string) (out *Order, err error)
- func (c *Client) BuyPickup(pickupID string, rate *PickupRate) (out *Pickup, err error)
- func (c *Client) BuyPickupWithContext(ctx context.Context, pickupID string, rate *PickupRate) (out *Pickup, err error)
- func (c *Client) BuyShipment(shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithEndShipper(shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithEndShipperWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string, ...) (out *Shipment, err error)
- func (c *Client) CancelClaim(claimID string) (out *Claim, err error)
- func (c *Client) CancelClaimWithContext(ctx context.Context, claimID string) (out *Claim, err error)
- func (c *Client) CancelPickup(pickupID string) (out *Pickup, err error)
- func (c *Client) CancelPickupWithContext(ctx context.Context, pickupID string) (out *Pickup, err error)
- func (c *Client) CreateAddress(in *Address, opts *CreateAddressOptions) (out *Address, err error)
- func (c *Client) CreateAddressWithContext(ctx context.Context, in *Address, opts *CreateAddressOptions) (out *Address, err error)
- func (c *Client) CreateAndBuyLumaShipment(in *LumaRequest) (out *Shipment, err error)
- func (c *Client) CreateAndBuyLumaShipmentWithContext(ctx context.Context, in *LumaRequest) (out *Shipment, err error)
- func (c *Client) CreateAndVerifyAddress(in *Address, opts *CreateAddressOptions) (out *Address, err error)
- func (c *Client) CreateAndVerifyAddressWithContext(ctx context.Context, in *Address, opts *CreateAddressOptions) (out *Address, err error)
- func (c *Client) CreateBatch(in ...*Shipment) (out *Batch, err error)
- func (c *Client) CreateBatchScanForms(batchID, format string) (out *Batch, err error)
- func (c *Client) CreateBatchScanFormsWithContext(ctx context.Context, batchID, format string) (out *Batch, err error)
- func (c *Client) CreateBatchWithContext(ctx context.Context, in ...*Shipment) (out *Batch, err error)
- func (c *Client) CreateCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) CreateCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) CreateClaim(in *CreateClaimParameters) (out *Claim, err error)
- func (c *Client) CreateClaimWithContext(ctx context.Context, in *CreateClaimParameters) (out *Claim, err error)
- func (c *Client) CreateCustomsInfo(in *CustomsInfo) (out *CustomsInfo, err error)
- func (c *Client) CreateCustomsInfoWithContext(ctx context.Context, in *CustomsInfo) (out *CustomsInfo, err error)
- func (c *Client) CreateCustomsItem(in *CustomsItem) (out *CustomsItem, err error)
- func (c *Client) CreateCustomsItemWithContext(ctx context.Context, in *CustomsItem) (out *CustomsItem, err error)
- func (c *Client) CreateEndShipper(in *Address) (out *Address, err error)
- func (c *Client) CreateEndShipperWithContext(ctx context.Context, in *Address) (out *Address, err error)
- func (c *Client) CreateInsurance(in *Insurance) (out *Insurance, err error)
- func (c *Client) CreateInsuranceWithContext(ctx context.Context, in *Insurance) (out *Insurance, err error)
- func (c *Client) CreateOauthCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) CreateOauthCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) CreateOrder(in *Order, accounts ...*CarrierAccount) (out *Order, err error)
- func (c *Client) CreateOrderWithContext(ctx context.Context, in *Order, accounts ...*CarrierAccount) (out *Order, err error)
- func (c *Client) CreateParcel(in *Parcel) (out *Parcel, err error)
- func (c *Client) CreateParcelWithContext(ctx context.Context, in *Parcel) (out *Parcel, err error)
- func (c *Client) CreatePickup(in *Pickup) (out *Pickup, err error)
- func (c *Client) CreatePickupWithContext(ctx context.Context, in *Pickup) (out *Pickup, err error)
- func (c *Client) CreateReferralCustomer(in *UserOptions) (out *ReferralCustomer, err error)
- func (c *Client) CreateReferralCustomerWithContext(ctx context.Context, in *UserOptions) (out *ReferralCustomer, err error)
- func (c *Client) CreateRefund(in map[string]interface{}) (out []*Refund, err error)
- func (c *Client) CreateRefundWithContext(ctx context.Context, in map[string]interface{}) (out []*Refund, err error)
- func (c *Client) CreateReport(typ string, in *Report) (out *Report, err error)
- func (c *Client) CreateReportWithContext(ctx context.Context, typ string, in *Report) (out *Report, err error)
- func (c *Client) CreateScanForm(shipmentIDs ...string) (out *ScanForm, err error)
- func (c *Client) CreateScanFormWithContext(ctx context.Context, shipmentIDs ...string) (out *ScanForm, err error)
- func (c *Client) CreateShipment(in *Shipment) (out *Shipment, err error)
- func (c *Client) CreateShipmentWithContext(ctx context.Context, in *Shipment) (out *Shipment, err error)
- func (c *Client) CreateTracker(opts *CreateTrackerOptions) (out *Tracker, err error)
- func (c *Client) CreateTrackerWithContext(ctx context.Context, opts *CreateTrackerOptions) (out *Tracker, err error)
- func (c *Client) CreateUpsCarrierAccount(in *UpsCarrierAccountCreationParameters) (out *CarrierAccount, err error)
- func (c *Client) CreateUpsCarrierAccountWithContext(ctx context.Context, in *UpsCarrierAccountCreationParameters) (out *CarrierAccount, err error)
- func (c *Client) CreateUser(in *UserOptions) (out *User, err error)
- func (c *Client) CreateUserWithContext(ctx context.Context, in *UserOptions) (out *User, err error)
- func (c *Client) CreateWebhook(data *CreateUpdateWebhookOptions) (out *Webhook, err error)
- func (c *Client) CreateWebhookWithContext(ctx context.Context, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
- func (c *Client) DeleteCarrierAccount(carrierAccountID string) error
- func (c *Client) DeleteCarrierAccountWithContext(ctx context.Context, carrierAccountID string) error
- func (c *Client) DeletePaymentMethod(priority PaymentMethodPriority) (err error)
- func (c *Client) DeletePaymentMethodWithContext(ctx context.Context, priority PaymentMethodPriority) (err error)
- func (c *Client) DeleteUser(userID string) error
- func (c *Client) DeleteUserWithContext(ctx context.Context, userID string) error
- func (c *Client) DeleteWebhook(webhookID string) error
- func (c *Client) DeleteWebhookWithContext(ctx context.Context, webhookID string) error
- func (c *Client) EstimateDeliveryDateForZipPair(params *EstimateDeliveryDateForZipPairParams) (out *EstimateDeliveryDateForZipPairResult, err error)
- func (c *Client) EstimateDeliveryDateForZipPairWithContext(ctx context.Context, params *EstimateDeliveryDateForZipPairParams) (out *EstimateDeliveryDateForZipPairResult, err error)
- func (c *Client) FundWallet(amount string, priority PaymentMethodPriority) (err error)
- func (c *Client) FundWalletWithContext(ctx context.Context, amount string, priority PaymentMethodPriority) (err error)
- func (c *Client) GenerateShipmentForm(shipmentID string, formType string) (out *Shipment, err error)
- func (c *Client) GenerateShipmentFormWithContext(ctx context.Context, shipmentID string, formType string) (out *Shipment, err error)
- func (c *Client) GenerateShipmentFormWithOptions(shipmentID string, formType string, formOptions map[string]interface{}) (out *Shipment, err error)
- func (c *Client) GenerateShipmentFormWithOptionsWithContext(ctx context.Context, shipmentID string, formType string, ...) (out *Shipment, err error)
- func (c *Client) GetAPIKeys() (out *APIKeys, err error)
- func (c *Client) GetAPIKeysForUser(userID string) (out *APIKeys, err error)
- func (c *Client) GetAPIKeysForUserWithContext(ctx context.Context, userID string) (out *APIKeys, err error)
- func (c *Client) GetAPIKeysWithContext(ctx context.Context) (out *APIKeys, err error)
- func (c *Client) GetAddress(addressID string) (out *Address, err error)
- func (c *Client) GetAddressWithContext(ctx context.Context, addressID string) (out *Address, err error)
- func (c *Client) GetBatch(batchID string) (out *Batch, err error)
- func (c *Client) GetBatchLabels(batchID, format string) (out *Batch, err error)
- func (c *Client) GetBatchLabelsWithContext(ctx context.Context, batchID, format string) (out *Batch, err error)
- func (c *Client) GetBatchWithContext(ctx context.Context, batchID string) (out *Batch, err error)
- func (c *Client) GetCarrierAccount(carrierAccountID string) (out *CarrierAccount, err error)
- func (c *Client) GetCarrierAccountWithContext(ctx context.Context, carrierAccountID string) (out *CarrierAccount, err error)
- func (c *Client) GetCarrierMetadata() (out []*CarrierMetadata, err error)
- func (c *Client) GetCarrierMetadataWithCarriers(carriers []string) (out []*CarrierMetadata, err error)
- func (c *Client) GetCarrierMetadataWithCarriersAndTypes(carriers []string, types []string) (out []*CarrierMetadata, err error)
- func (c *Client) GetCarrierMetadataWithContext(ctx context.Context, carriers []string, types []string) (out []*CarrierMetadata, err error)
- func (c *Client) GetCarrierMetadataWithTypes(types []string) (out []*CarrierMetadata, err error)
- func (c *Client) GetCarrierTypes() (out []*CarrierType, err error)
- func (c *Client) GetCarrierTypesWithContext(ctx context.Context) (out []*CarrierType, err error)
- func (c *Client) GetClaim(claimID string) (out *Claim, err error)
- func (c *Client) GetClaimWithContext(ctx context.Context, claimID string) (out *Claim, err error)
- func (c *Client) GetCustomsInfo(customsInfoID string) (out *CustomsInfo, err error)
- func (c *Client) GetCustomsInfoWithContext(ctx context.Context, customsInfoID string) (out *CustomsInfo, err error)
- func (c *Client) GetCustomsItem(customsItemID string) (out *CustomsItem, err error)
- func (c *Client) GetCustomsItemWithContext(ctx context.Context, customsItemID string) (out *CustomsItem, err error)
- func (c *Client) GetEndShipper(endshipperID string) (out *Address, err error)
- func (c *Client) GetEndShipperWithContext(ctx context.Context, endshipperID string) (out *Address, err error)
- func (c *Client) GetEvent(eventID string) (out *Event, err error)
- func (c *Client) GetEventPayload(eventID, payloadID string) (out *EventPayload, err error)
- func (c *Client) GetEventPayloadWithContext(ctx context.Context, eventID, payloadID string) (out *EventPayload, err error)
- func (c *Client) GetEventWithContext(ctx context.Context, eventID string) (out *Event, err error)
- func (c *Client) GetInsurance(insuranceID string) (out *Insurance, err error)
- func (c *Client) GetInsuranceWithContext(ctx context.Context, insuranceID string) (out *Insurance, err error)
- func (c *Client) GetLumaPromise(in *LumaRequest) (out *LumaInfo, err error)
- func (c *Client) GetLumaPromiseWithContext(ctx context.Context, in *LumaRequest) (out *LumaInfo, err error)
- func (c *Client) GetNextAddressPage(collection *ListAddressResult) (out *ListAddressResult, err error)
- func (c *Client) GetNextAddressPageWithContext(ctx context.Context, collection *ListAddressResult) (out *ListAddressResult, err error)
- func (c *Client) GetNextAddressPageWithPageSize(collection *ListAddressResult, pageSize int) (out *ListAddressResult, err error)
- func (c *Client) GetNextAddressPageWithPageSizeWithContext(ctx context.Context, collection *ListAddressResult, pageSize int) (out *ListAddressResult, err error)
- func (c *Client) GetNextChildUserPage(collection *ListChildUsersResult) (out *ListChildUsersResult, err error)
- func (c *Client) GetNextChildUserPageWithContext(ctx context.Context, collection *ListChildUsersResult) (out *ListChildUsersResult, err error)
- func (c *Client) GetNextChildUserPageWithPageSize(collection *ListChildUsersResult, pageSize int) (out *ListChildUsersResult, err error)
- func (c *Client) GetNextChildUserPageWithPageSizeWithContext(ctx context.Context, collection *ListChildUsersResult, pageSize int) (out *ListChildUsersResult, err error)
- func (c *Client) GetNextClaimPage(collection *ListClaimsResult) (out *ListClaimsResult, err error)
- func (c *Client) GetNextClaimPageWithContext(ctx context.Context, collection *ListClaimsResult) (out *ListClaimsResult, err error)
- func (c *Client) GetNextClaimPageWithPageSize(collection *ListClaimsResult, pageSize int) (out *ListClaimsResult, err error)
- func (c *Client) GetNextClaimPageWithPageSizeWithContext(ctx context.Context, collection *ListClaimsResult, pageSize int) (out *ListClaimsResult, err error)
- func (c *Client) GetNextEventPage(collection *ListEventsResult) (out *ListEventsResult, err error)
- func (c *Client) GetNextEventPageWithContext(ctx context.Context, collection *ListEventsResult) (out *ListEventsResult, err error)
- func (c *Client) GetNextEventPageWithPageSize(collection *ListEventsResult, pageSize int) (out *ListEventsResult, err error)
- func (c *Client) GetNextEventPageWithPageSizeWithContext(ctx context.Context, collection *ListEventsResult, pageSize int) (out *ListEventsResult, err error)
- func (c *Client) GetNextInsurancePage(collection *ListInsurancesResult) (out *ListInsurancesResult, err error)
- func (c *Client) GetNextInsurancePageWithContext(ctx context.Context, collection *ListInsurancesResult) (out *ListInsurancesResult, err error)
- func (c *Client) GetNextInsurancePageWithPageSize(collection *ListInsurancesResult, pageSize int) (out *ListInsurancesResult, err error)
- func (c *Client) GetNextInsurancePageWithPageSizeWithContext(ctx context.Context, collection *ListInsurancesResult, pageSize int) (out *ListInsurancesResult, err error)
- func (c *Client) GetNextPickupPage(collection *ListPickupResult) (out *ListPickupResult, err error)
- func (c *Client) GetNextPickupPageWithContext(ctx context.Context, collection *ListPickupResult) (out *ListPickupResult, err error)
- func (c *Client) GetNextPickupPageWithPageSize(collection *ListPickupResult, pageSize int) (out *ListPickupResult, err error)
- func (c *Client) GetNextPickupPageWithPageSizeWithContext(ctx context.Context, collection *ListPickupResult, pageSize int) (out *ListPickupResult, err error)
- func (c *Client) GetNextReferralCustomerPage(collection *ListReferralCustomersResult) (out *ListReferralCustomersResult, err error)
- func (c *Client) GetNextReferralCustomerPageWithContext(ctx context.Context, collection *ListReferralCustomersResult) (out *ListReferralCustomersResult, err error)
- func (c *Client) GetNextReferralCustomerPageWithPageSize(collection *ListReferralCustomersResult, pageSize int) (out *ListReferralCustomersResult, err error)
- func (c *Client) GetNextReferralCustomerPageWithPageSizeWithContext(ctx context.Context, collection *ListReferralCustomersResult, pageSize int) (out *ListReferralCustomersResult, err error)
- func (c *Client) GetNextRefundPage(collection *ListRefundResult) (out *ListRefundResult, err error)
- func (c *Client) GetNextRefundPageWithContext(ctx context.Context, collection *ListRefundResult) (out *ListRefundResult, err error)
- func (c *Client) GetNextRefundPageWithPageSize(collection *ListRefundResult, pageSize int) (out *ListRefundResult, err error)
- func (c *Client) GetNextRefundPageWithPageSizeWithContext(ctx context.Context, collection *ListRefundResult, pageSize int) (out *ListRefundResult, err error)
- func (c *Client) GetNextReportPage(collection *ListReportsResult) (out *ListReportsResult, err error)
- func (c *Client) GetNextReportPageWithContext(ctx context.Context, collection *ListReportsResult) (out *ListReportsResult, err error)
- func (c *Client) GetNextReportPageWithPageSize(collection *ListReportsResult, pageSize int) (out *ListReportsResult, err error)
- func (c *Client) GetNextReportPageWithPageSizeWithContext(ctx context.Context, collection *ListReportsResult, pageSize int) (out *ListReportsResult, err error)
- func (c *Client) GetNextScanFormPage(collection *ListScanFormsResult) (out *ListScanFormsResult, err error)
- func (c *Client) GetNextScanFormPageWithContext(ctx context.Context, collection *ListScanFormsResult) (out *ListScanFormsResult, err error)
- func (c *Client) GetNextScanFormPageWithPageSize(collection *ListScanFormsResult, pageSize int) (out *ListScanFormsResult, err error)
- func (c *Client) GetNextScanFormPageWithPageSizeWithContext(ctx context.Context, collection *ListScanFormsResult, pageSize int) (out *ListScanFormsResult, err error)
- func (c *Client) GetNextShipmentPage(collection *ListShipmentsResult) (out *ListShipmentsResult, err error)
- func (c *Client) GetNextShipmentPageWithContext(ctx context.Context, collection *ListShipmentsResult) (out *ListShipmentsResult, err error)
- func (c *Client) GetNextShipmentPageWithPageSize(collection *ListShipmentsResult, pageSize int) (out *ListShipmentsResult, err error)
- func (c *Client) GetNextShipmentPageWithPageSizeWithContext(ctx context.Context, collection *ListShipmentsResult, pageSize int) (out *ListShipmentsResult, err error)
- func (c *Client) GetNextTrackerPage(collection *ListTrackersResult) (out *ListTrackersResult, err error)
- func (c *Client) GetNextTrackerPageWithContext(ctx context.Context, collection *ListTrackersResult) (out *ListTrackersResult, err error)
- func (c *Client) GetNextTrackerPageWithPageSize(collection *ListTrackersResult, pageSize int) (out *ListTrackersResult, err error)
- func (c *Client) GetNextTrackerPageWithPageSizeWithContext(ctx context.Context, collection *ListTrackersResult, pageSize int) (out *ListTrackersResult, err error)
- func (c *Client) GetOrder(orderID string) (out *Order, err error)
- func (c *Client) GetOrderRates(orderID string) (out *Order, err error)
- func (c *Client) GetOrderRatesWithContext(ctx context.Context, orderID string) (out *Order, err error)
- func (c *Client) GetOrderWithContext(ctx context.Context, orderID string) (out *Order, err error)
- func (c *Client) GetParcel(parcelID string) (out *Parcel, err error)
- func (c *Client) GetParcelWithContext(ctx context.Context, parcelID string) (out *Parcel, err error)
- func (c *Client) GetPaymentEndpointByPrimaryOrSecondary(primaryOrSecondary PaymentMethodPriority) (out string)
- func (c *Client) GetPickup(pickupID string) (out *Pickup, err error)
- func (c *Client) GetPickupWithContext(ctx context.Context, pickupID string) (out *Pickup, err error)
- func (c *Client) GetRate(rateID string) (out *Rate, err error)
- func (c *Client) GetRateWithContext(ctx context.Context, rateID string) (out *Rate, err error)
- func (c *Client) GetRefund(refundID string) (out *Refund, err error)
- func (c *Client) GetRefundWithContext(ctx context.Context, refundID string) (out *Refund, err error)
- func (c *Client) GetReport(typ, reportID string) (out *Report, err error)
- func (c *Client) GetReportWithContext(ctx context.Context, typ, reportID string) (out *Report, err error)
- func (c *Client) GetScanForm(scanFormID string) (out *ScanForm, err error)
- func (c *Client) GetScanFormWithContext(ctx context.Context, scanFormID string) (out *ScanForm, err error)
- func (c *Client) GetShipment(shipmentID string) (out *Shipment, err error)
- func (c *Client) GetShipmentEstimatedDeliveryDate(shipmentID string, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
- func (c *Client) GetShipmentEstimatedDeliveryDateWithContext(ctx context.Context, shipmentID string, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
- func (c *Client) GetShipmentLabel(shipmentID, format string) (out *Shipment, err error)
- func (c *Client) GetShipmentLabelWithContext(ctx context.Context, shipmentID, format string) (out *Shipment, err error)
- func (c *Client) GetShipmentSmartrates(shipmentID string) (out []*SmartRate, err error)
- func (c *Client) GetShipmentSmartratesWithContext(ctx context.Context, shipmentID string) (out []*SmartRate, err error)
- func (c *Client) GetShipmentWithContext(ctx context.Context, shipmentID string) (out *Shipment, err error)
- func (c *Client) GetTracker(trackerID string) (out *Tracker, err error)
- func (c *Client) GetTrackerWithContext(ctx context.Context, trackerID string) (out *Tracker, err error)
- func (c *Client) GetUser(userID string) (out *User, err error)
- func (c *Client) GetUserWithContext(ctx context.Context, userID string) (out *User, err error)
- func (c *Client) GetWebhook(webhookID string) (out *Webhook, err error)
- func (c *Client) GetWebhookWithContext(ctx context.Context, webhookID string) (out *Webhook, err error)
- func (c *Client) InsureShipment(shipmentID, amount string) (out *Shipment, err error)
- func (c *Client) InsureShipmentWithContext(ctx context.Context, shipmentID, amount string) (out *Shipment, err error)
- func (c *Client) ListAddresses(opts *ListOptions) (out *ListAddressResult, err error)
- func (c *Client) ListAddressesWithContext(ctx context.Context, opts *ListOptions) (out *ListAddressResult, err error)
- func (c *Client) ListBatches(opts *ListOptions) (out *ListBatchesResult, err error)
- func (c *Client) ListBatchesWithContext(ctx context.Context, opts *ListOptions) (out *ListBatchesResult, err error)
- func (c *Client) ListCarrierAccounts() (out []*CarrierAccount, err error)
- func (c *Client) ListCarrierAccountsWithContext(ctx context.Context) (out []*CarrierAccount, err error)
- func (c *Client) ListChildUsers(opts *ListOptions) (out *ListChildUsersResult, err error)
- func (c *Client) ListChildUsersWithContext(ctx context.Context, opts *ListOptions) (out *ListChildUsersResult, err error)
- func (c *Client) ListClaims(opts *ListClaimsParameters) (out *ListClaimsResult, err error)
- func (c *Client) ListClaimsWithContext(ctx context.Context, opts *ListClaimsParameters) (out *ListClaimsResult, err error)
- func (c *Client) ListEndShippers(opts *ListOptions) (out *ListEndShipperResult, err error)
- func (c *Client) ListEndShippersWithContext(ctx context.Context, opts *ListOptions) (out *ListEndShipperResult, err error)
- func (c *Client) ListEventPayloads(eventID string) (out []*EventPayload, err error)
- func (c *Client) ListEventPayloadsWithContext(ctx context.Context, eventID string) (out []*EventPayload, err error)
- func (c *Client) ListEvents(opts *ListOptions) (out *ListEventsResult, err error)
- func (c *Client) ListEventsWithContext(ctx context.Context, opts *ListOptions) (out *ListEventsResult, err error)
- func (c *Client) ListInsurances(opts *ListOptions) (out *ListInsurancesResult, err error)
- func (c *Client) ListInsurancesWithContext(ctx context.Context, opts *ListOptions) (out *ListInsurancesResult, err error)
- func (c *Client) ListPickups(opts *ListOptions) (out *ListPickupResult, err error)
- func (c *Client) ListPickupsWithContext(ctx context.Context, opts *ListOptions) (out *ListPickupResult, err error)
- func (c *Client) ListReferralCustomers(opts *ListOptions) (out *ListReferralCustomersResult, err error)
- func (c *Client) ListReferralCustomersWithContext(ctx context.Context, opts *ListOptions) (out *ListReferralCustomersResult, err error)
- func (c *Client) ListRefunds(opts *ListOptions) (out *ListRefundResult, err error)
- func (c *Client) ListRefundsWithContext(ctx context.Context, opts *ListOptions) (out *ListRefundResult, err error)
- func (c *Client) ListReports(typ string, opts *ListOptions) (out *ListReportsResult, err error)
- func (c *Client) ListReportsWithContext(ctx context.Context, typ string, opts *ListOptions) (out *ListReportsResult, err error)
- func (c *Client) ListScanForms(opts *ListOptions) (out *ListScanFormsResult, err error)
- func (c *Client) ListScanFormsWithContext(ctx context.Context, opts *ListOptions) (out *ListScanFormsResult, err error)
- func (c *Client) ListShipments(opts *ListShipmentsOptions) (out *ListShipmentsResult, err error)
- func (c *Client) ListShipmentsWithContext(ctx context.Context, opts *ListShipmentsOptions) (out *ListShipmentsResult, err error)
- func (c *Client) ListTrackers(opts *ListTrackersOptions) (out *ListTrackersResult, err error)
- func (c *Client) ListTrackersWithContext(ctx context.Context, opts *ListTrackersOptions) (out *ListTrackersResult, err error)
- func (c *Client) ListWebhooks() (out []*Webhook, err error)
- func (c *Client) ListWebhooksWithContext(ctx context.Context) (out []*Webhook, err error)
- func (c *Client) LowestOrderRate(order *Order) (out Rate, err error)
- func (c *Client) LowestOrderRateWithCarrier(order *Order, carriers []string) (out Rate, err error)
- func (c *Client) LowestOrderRateWithCarrierAndService(order *Order, carriers []string, services []string) (out Rate, err error)
- func (c *Client) LowestPickupRate(pickup *Pickup) (out PickupRate, err error)
- func (c *Client) LowestPickupRateWithCarrier(pickup *Pickup, carriers []string) (out PickupRate, err error)
- func (c *Client) LowestPickupRateWithCarrierAndService(pickup *Pickup, carriers []string, services []string) (out PickupRate, err error)
- func (c *Client) LowestShipmentRate(shipment *Shipment) (out Rate, err error)
- func (c *Client) LowestShipmentRateWithCarrier(shipment *Shipment, carriers []string) (out Rate, err error)
- func (c *Client) LowestShipmentRateWithCarrierAndService(shipment *Shipment, carriers []string, services []string) (out Rate, err error)
- func (c *Client) LowestSmartrate(shipment *Shipment, deliveryDays int, deliveryAccuracy string) (out SmartRate, err error)
- func (c *Client) LowestStatelessRate(rates []*StatelessRate) (out StatelessRate, err error)
- func (c *Client) LowestStatelessRateWithCarrier(rates []*StatelessRate, carriers []string) (out StatelessRate, err error)
- func (c *Client) LowestStatelessRateWithCarrierAndService(rates []*StatelessRate, carriers []string, services []string) (out StatelessRate, err error)
- func (c *Client) RecommendShipDateForShipment(shipmentID string, desiredDeliveryDate string) (out []*RecommendShipDateForShipmentResult, err error)
- func (c *Client) RecommendShipDateForShipmentWithContext(ctx context.Context, shipmentID string, desiredDeliveryDate string) (out []*RecommendShipDateForShipmentResult, err error)
- func (c *Client) RecommendShipDateForZipPair(params *RecommendShipDateForZipPairParams) (out *RecommendShipDateForZipPairResult, err error)
- func (c *Client) RecommendShipDateForZipPairWithContext(ctx context.Context, params *RecommendShipDateForZipPairParams) (out *RecommendShipDateForZipPairResult, err error)
- func (c *Client) RefundInsurance(insuranceID string) (out *Insurance, err error)
- func (c *Client) RefundInsuranceWithContext(ctx context.Context, insuranceID string) (out *Insurance, err error)
- func (c *Client) RefundShipment(shipmentID string) (out *Shipment, err error)
- func (c *Client) RefundShipmentWithContext(ctx context.Context, shipmentID string) (out *Shipment, err error)
- func (c *Client) RemoveShipmentsFromBatch(batchID string, shipments ...*Shipment) (out *Batch, err error)
- func (c *Client) RemoveShipmentsFromBatchWithContext(ctx context.Context, batchID string, shipments ...*Shipment) (out *Batch, err error)
- func (c *Client) RerateShipment(shipmentID string) (out []*Rate, err error)
- func (c *Client) RerateShipmentWithContext(ctx context.Context, shipmentID string) (out []*Rate, err error)
- func (c *Client) RetrieveMe() (out *User, err error)
- func (c *Client) RetrieveMeWithContext(ctx context.Context) (out *User, err error)
- func (c *Client) RetrievePaymentMethods() (out *PaymentMethod, err error)
- func (c *Client) RetrievePaymentMethodsWithContext(ctx context.Context) (out *PaymentMethod, err error)
- func (c *Client) UpdateBrand(userID string, params map[string]interface{}) (out *Brand, err error)
- func (c *Client) UpdateBrandWithContext(ctx context.Context, userID string, params map[string]interface{}) (out *Brand, err error)
- func (c *Client) UpdateCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) UpdateCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
- func (c *Client) UpdateEndShippers(in *Address) (out *Address, err error)
- func (c *Client) UpdateEndShippersWithContext(ctx context.Context, in *Address) (out *Address, err error)
- func (c *Client) UpdateReferralCustomerEmail(userId string, email string) (out *ReferralCustomer, err error)
- func (c *Client) UpdateReferralCustomerEmailWithContext(ctx context.Context, userId string, email string) (out *ReferralCustomer, err error)
- func (c *Client) UpdateUpsCarrierAccount(id string, in *UpsCarrierAccountUpdateParameters) (out *CarrierAccount, err error)
- func (c *Client) UpdateUpsCarrierAccountWithContext(ctx context.Context, id string, in *UpsCarrierAccountUpdateParameters) (out *CarrierAccount, err error)
- func (c *Client) UpdateUser(in *UserOptions) (out *User, err error)
- func (c *Client) UpdateUserWithContext(ctx context.Context, in *UserOptions) (out *User, err error)
- func (c *Client) UpdateWebhook(webhookID string, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
- func (c *Client) UpdateWebhookWithContext(ctx context.Context, webhookID string, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
- func (c *Client) ValidateWebhook(eventBody []byte, headers map[string]interface{}, webhookSecret string) (out *Event, err error)
- func (c *Client) ValidateWebhookWithContext(ctx context.Context, eventBody []byte, headers map[string]interface{}, ...) (out *Event, err error)
- func (c *Client) VerifyAddress(addressID string) (out *Address, err error)
- func (c *Client) VerifyAddressWithContext(ctx context.Context, addressID string) (out *Address, err error)
- type ConnectionError
- type CreateAddressOptions
- type CreateClaimParameters
- type CreateTrackerOptions
- type CreateUpdateWebhookOptions
- type CreditCardOptions
- type CustomsInfo
- type CustomsItem
- type DateTime
- type DeliveryDateForZipPairEstimate
- type EasyPostTimeInTransitData
- type EndOfPaginationError
- type EstimateDeliveryDateForZipPairParams
- type EstimateDeliveryDateForZipPairResult
- type EstimatedDeliveryDate
- type Event
- type EventPayload
- type ExternalApiError
- type Fee
- type FieldError
- type FilteringError
- type ForbiddenError
- type Form
- type GatewayTimeoutError
- type HookEvent
- type HookEventSubscriber
- type Hooks
- func (h *Hooks) AddRequestEventSubscriber(subscriber RequestHookEventSubscriber)
- func (h *Hooks) AddResponseEventSubscriber(subscriber ResponseHookEventSubscriber)
- func (h *Hooks) RemoveRequestEventSubscriber(subscriber RequestHookEventSubscriber)
- func (h *Hooks) RemoveResponseEventSubscriber(subscriber ResponseHookEventSubscriber)
- type Insurance
- type InternalServerError
- type InvalidFunctionError
- type InvalidObjectError
- type InvalidRequestError
- type LibraryError
- type ListAddressResult
- type ListBatchesResult
- type ListChildUsersResult
- type ListClaimsParameters
- type ListClaimsResult
- type ListEndShipperResult
- type ListEventsResult
- type ListInsurancesResult
- type ListOptions
- type ListPickupResult
- type ListReferralCustomersResult
- type ListRefundResult
- type ListReportsResult
- type ListScanFormsResult
- type ListShipmentsOptions
- type ListShipmentsResult
- type ListTrackersOptions
- type ListTrackersResult
- type ListTrackersUpdatedOptions
- type LocalError
- type LumaInfo
- type LumaPromiseResponse
- type LumaRequest
- type MandateData
- type MetadataPredefinedPackage
- type MetadataServiceLevel
- type MetadataShipmentOption
- type MetadataSupportedFeature
- type MethodNotAllowedError
- type MinifiedRate
- type MismatchWebhookSignatureError
- type MissingPropertyError
- type MissingWebhookSignatureError
- type MockRequest
- type MockRequestMatchRule
- type MockRequestResponseInfo
- type NotFoundError
- type Order
- type PaginatedCollection
- type Parcel
- type Payment
- type PaymentError
- type PaymentLog
- type PaymentMethod
- type PaymentMethodObject
- type PaymentMethodPriority
- type PaymentMethodType
- type Pickup
- type PickupRate
- type PostageLabel
- type ProxyError
- type Rate
- type RateLimitError
- type RecommendShipDateForShipmentResult
- type RecommendShipDateForZipPairParams
- type RecommendShipDateForZipPairResult
- type RedirectError
- type ReferralCustomer
- type Refund
- type Report
- type RequestHookEvent
- type RequestHookEventSubscriber
- type RequestHookEventSubscriberCallback
- type ResponseHookEvent
- type ResponseHookEventSubscriber
- type ResponseHookEventSubscriberCallback
- type RetryError
- type SSLError
- type ScanForm
- type ServiceUnavailableError
- type ShipDateForZipPairRecommendation
- type Shipment
- type ShipmentOptions
- type SmartRate
- type StatelessRate
- type TaxIdentifier
- type TimeInTransit
- type TimeInTransitDetailsForDeliveryDate
- type TimeInTransitDetailsForShipDate
- type TimeoutError
- type Tracker
- type TrackingCarrierDetail
- type TrackingDetail
- type TrackingLocation
- type UnauthorizedError
- type UnknownHttpError
- type UpsCarrierAccountCreationParameters
- type UpsCarrierAccountUpdateParameters
- type User
- type UserOptions
- type Webhook
- type WebhookCustomHeader
- type WrappedLumaRequest
Constants ¶
const Version = "5.2.0"
Variables ¶
var ApiDidNotReturnErrorDetails = "API did not return error details"
var ApiErrorDetailsParsingError = "RESPONSE.PARSE_ERROR"
var InvalidParameter = "Invalid parameter: "
var JsonDeserializationErrorMessage = "Error deserializing JSON into object of type "
var JsonNoDataErrorMessage = "No data was provided to serialize"
var JsonSerializationErrorMessage = "Error serializing object of type "
var MismatchWebhookSignature = "Webhook received did not originate from EasyPost or had a webhook secret mismatch"
var MissingProperty = "Missing property: "
var MissingRequiredParameter = "Missing required parameter: "
var MissingWebhookSignature = "Webhook does not contain a valid HMAC signature."
var NoMatchingPaymentMethod = "No matching payment method type found"
var NoPagesLeftToRetrieve = "There are no more pages to retrieve"
var NoPaymentMethods = "No payment methods are set up. Please add a payment method and try again."
var NoRatesFoundMatchingFilters = "No rates found matching the given filters"
var NoUserFoundForId = "No user found for the given ID"
var PaymentMethodNotSetUp = "The chosen payment method is not set up yet"
Functions ¶
func BuildErrorFromResponse ¶
BuildErrorFromResponse returns an APIError-based object based on the HTTP response. Do not pass a non-error response to this function.
func UnmarshalJSONObject ¶
UnmarshalJSONObject attempts to unmarshal an easypost object from JSON data. An error is only returned if data is non-zero length and JSON decoding fails. If data contains a valid JSON object with an "object" key/value that matches a known object type, it will return a pointer to the corresponding object type from this package, e.g. *Address, *Batch, *Refund, etc. If the decoded JSON doesn't match, the return value will be the default type stored by json.Unmarshal.
Types ¶
type APIError ¶
type APIError struct { LibraryError // subtype of LibraryError // Code is a machine-readable status of the problem encountered. Code string `json:"code,omitempty" url:"code,omitempty"` // StatusCode is the HTTP numerical status code of the response. StatusCode int // Errors may be provided if there are details about server-side issues that caused the API request to fail. Errors interface{} `json:"errors,omitempty" url:"errors,omitempty"` }
APIError represents an error that occurred while communicating with the EasyPost API.
This is typically due to a specific HTTP status code, such as 4xx or 5xx.
The information from the top-level `error` key is used to generate this error, and any sub-errors are stored in the Errors field.
type APIKey ¶
type APIKey struct { Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` Key string `json:"key,omitempty" url:"key,omitempty"` }
APIKey represents a single API key.
type APIKeys ¶
type APIKeys struct { ID string `json:"id,omitempty" url:"id,omitempty"` Children []*APIKeys `json:"children,omitempty" url:"children,omitempty"` Keys []*APIKey `json:"keys,omitempty" url:"keys,omitempty"` }
APIKeys contains information about a list of API keys for the given user and any child users.
type Address ¶
type Address struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Street1 string `json:"street1,omitempty" url:"street1,omitempty"` Street2 string `json:"street2,omitempty" url:"street2,omitempty"` City string `json:"city,omitempty" url:"city,omitempty"` State string `json:"state,omitempty" url:"state,omitempty"` Zip string `json:"zip,omitempty" url:"zip,omitempty"` Country string `json:"country,omitempty" url:"country,omitempty"` Name string `json:"name,omitempty" url:"name,omitempty"` Company string `json:"company,omitempty" url:"company,omitempty"` Phone string `json:"phone,omitempty" url:"phone,omitempty"` Email string `json:"email,omitempty" url:"email,omitempty"` Residential bool `json:"residential,omitempty" url:"residential,omitempty"` CarrierFacility string `json:"carrier_facility,omitempty" url:"carrier_facility,omitempty"` FederalTaxID string `json:"federal_tax_id,omitempty" url:"federal_tax_id,omitempty"` StateTaxID string `json:"state_tax_id,omitempty" url:"state_tax_id,omitempty"` Verifications *AddressVerifications `json:"verifications,omitempty" url:"verifications,omitempty"` }
Address objects are used to represent people, places, and organizations in a number of contexts.
type AddressVerification ¶
type AddressVerification struct { Success bool `json:"success,omitempty" url:"success,omitempty"` Errors []*AddressVerificationFieldError `json:"errors,omitempty" url:"errors,omitempty"` Details *AddressVerificationDetails `json:"details,omitempty" url:"details,omitempty"` }
AddressVerification holds data relating to address verification status.
type AddressVerificationDetails ¶
type AddressVerificationDetails struct { Latitude float64 `json:"latitude,omitempty" url:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty" url:"longitude,omitempty"` TimeZone string `json:"time_zone,omitempty" url:"time_zone,omitempty"` }
AddressVerificationDetails contains extra information related to address verification.
type AddressVerificationFieldError ¶
type AddressVerificationFieldError struct { Code string `json:"code,omitempty" url:"code,omitempty"` Field string `json:"field,omitempty" url:"field,omitempty"` Message string `json:"message,omitempty" url:"message,omitempty"` Suggestion string `json:"suggestion,omitempty" url:"suggestion,omitempty"` }
AddressVerificationFieldError provides additional information on address validation errors.
type AddressVerifications ¶
type AddressVerifications struct { ZIP4 *AddressVerification `json:"zip4,omitempty" url:"zip4,omitempty"` Delivery *AddressVerification `json:"delivery,omitempty" url:"delivery,omitempty"` }
AddressVerifications contains the result of the requested address verifications.
type AddressVerifyResponse ¶
type AddressVerifyResponse struct {
Address *Address `json:"address,omitempty" url:"address,omitempty"`
}
type AiResults ¶ added in v5.2.0
type AiResults struct { Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` MeetsRulesetRequirements bool `json:"meets_ruleset_requirements,omitempty" url:"meets_ruleset_requirements,omitempty"` PredictedDeliverByDate *DateTime `json:"predicted_delivery_date,omitempty" url:"predicted_delivery_date,omitempty"` PredictedDeliverDays int `json:"predicted_delivery_days,omitempty" url:"predicted_delivery_days,omitempty"` RateID string `json:"rate_id,omitempty" url:"rate_id,omitempty"` RateUSD string `json:"rate_usd,omitempty" url:"rate_usd,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` }
AiResults contains the results of the AI analysis for a shipment.
type BadRequestError ¶
type BadRequestError struct {
APIError // subtype of APIError
}
BadRequestError is raised when the API returns a 400 status code.
func (*BadRequestError) Unwrap ¶
func (e *BadRequestError) Unwrap() error
Unwrap returns the underlying APIError error.
type Batch ¶
type Batch struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` State string `json:"state,omitempty" url:"state,omitempty"` NumShipments int `json:"num_shipments,omitempty" url:"num_shipments,omitempty"` Shipments []*Shipment `json:"shipments,omitempty" url:"shipments,omitempty"` Status *BatchStatus `json:"status,omitempty" url:"status,omitempty"` LabelURL string `json:"label_url,omitempty" url:"label_url,omitempty"` ScanForm *ScanForm `json:"scan_form,omitempty" url:"scan_form,omitempty"` Pickup *Pickup `json:"pickup,omitempty" url:"pickup,omitempty"` }
Batch represents a batch of shipments.
type BatchStatus ¶
type BatchStatus struct { PostagePurchased int `json:"postage_purchased,omitempty" url:"postage_purchased,omitempty"` PostagePurchaseFailed int `json:"postage_purchase_failed,omitempty" url:"postage_purchase_failed,omitempty"` QueuedForPurchase int `json:"queued_for_purchase,omitempty" url:"queued_for_purchase,omitempty"` CreationFailed int `json:"creation_failed,omitempty" url:"creation_failed,omitempty"` }
BatchStatus contains counts of statuses for the shipments in a batch.
type BetaPaymentRefund ¶
type BetaPaymentRefund struct { RefundedAmount int `json:"refunded_amount,omitempty" url:"refunded_amount,omitempty"` RefundedPaymentLogs []string `json:"refunded_payment_log,omitempty" url:"refunded_payment_log,omitempty"` PaymentLogId string `json:"payment_log_id,omitempty" url:"payment_log_id,omitempty"` Errors []APIError `json:"errors,omitempty" url:"errors,omitempty"` }
A BetaPaymentRefund that has the refund details for the refund request.
type Brand ¶
type Brand struct { ID string `json:"id,omitempty" url:"id,omitempty"` BackgroundColor string `json:"background_color,omitempty" url:"background_color,omitempty"` Color string `json:"color,omitempty" url:"color,omitempty"` Logo string `json:"logo,omitempty" url:"logo,omitempty"` LogoHref string `json:"logo_href,omitempty" url:"logo_href,omitempty"` Ad string `json:"ad,omitempty" url:"ad,omitempty"` AdHref string `json:"ad_href,omitempty" url:"ad_href,omitempty"` Name string `json:"name,omitempty" url:"name,omitempty"` UserID string `json:"user_id,omitempty" url:"user_id,omitempty"` Theme string `json:"theme,omitempty" url:"theme,omitempty"` }
Brand contains data for a user brand
type CarrierAccount ¶
type CarrierAccount struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Fields *CarrierFields `json:"fields,omitempty" url:"fields,omitempty"` Clone bool `json:"clone,omitempty" url:"clone,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Readable string `json:"readable,omitempty" url:"readable,omitempty"` Credentials map[string]string `json:"credentials,omitempty" url:"credentials,omitempty"` TestCredentials map[string]string `json:"test_credentials,omitempty" url:"test_credentials,omitempty"` RegistrationData map[string]interface{} `json:"registration_data,omitempty" url:"registration_data,omitempty"` BillingType string `json:"billing_type,omitempty" url:"billing_type,omitempty"` }
CarrierAccount encapsulates credentials and other information related to a carrier account. This struct is also used as a parameter set for creating and updating non-UPS carrier accounts.
type CarrierField ¶
type CarrierField struct { Visibility string `json:"visibility,omitempty" url:"visibility,omitempty"` Label string `json:"label,omitempty" url:"label,omitempty"` Value string `json:"value,omitempty" url:"value,omitempty"` }
CarrierField provides data for a single field in a carrier account.
type CarrierFields ¶
type CarrierFields struct { Credentials map[string]*CarrierField `json:"credentials,omitempty" url:"credentials,omitempty"` TestCredentials map[string]*CarrierField `json:"test_credentials,omitempty" url:"test_credentials,omitempty"` AutoLink bool `json:"auto_link,omitempty" url:"auto_link,omitempty"` CustomWorkflow bool `json:"custom_workflow,omitempty" url:"custom_workflow,omitempty"` }
CarrierFields contains the data for carrier account fields for production and/or test credentials.
type CarrierMessage ¶
type CarrierMessage struct { Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Message string `json:"message,omitempty" url:"message,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty" url:"carrier_account_id,omitempty"` }
CarrierMessage contains additional status data that is provided by some carriers for certain operations.
type CarrierMetadata ¶
type CarrierMetadata struct { Name string `json:"name,omitempty" url:"name,omitempty"` HumanReadable string `json:"human_readable,omitempty" url:"human_readable,omitempty"` ServiceLevels []*MetadataServiceLevel `json:"service_levels,omitempty" url:"service_levels,omitempty"` PredefinedPackages []*MetadataPredefinedPackage `json:"predefined_packages,omitempty" url:"predefined_packages,omitempty"` ShipmentOptions []*MetadataShipmentOption `json:"shipment_options,omitempty" url:"shipment_options,omitempty"` SupportedFeatures []*MetadataSupportedFeature `json:"supported_features,omitempty" url:"supported_features,omitempty"` }
CarrierMetadata represents all the metadata for a carrier.
type CarrierType ¶
type CarrierType struct { Object string `json:"object,omitempty" url:"object,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Readable string `json:"readable,omitempty" url:"readable,omitempty"` Logo string `json:"logo,omitempty" url:"logo,omitempty"` Fields *CarrierFields `json:"fields,omitempty" url:"fields,omitempty"` }
CarrierType contains information on a supported carrier. It can be used to determine the valid fields for a carrier account.
type Claim ¶
type Claim struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` ApprovedAmount string `json:"approved_amount,omitempty" url:"approved_amount,omitempty"` Attachments []string `json:"attachments,omitempty" url:"attachments,omitempty"` CheckDeliveryAddress string `json:"check_delivery_address,omitempty" url:"check_delivery_address,omitempty"` ContactEmail string `json:"contact_email,omitempty" url:"contact_email,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` History []ClaimHistoryEntry `json:"history,omitempty" url:"history,omitempty"` InsuranceAmount string `json:"insurance_amount,omitempty" url:"insurance_amount,omitempty"` InsuranceId string `json:"insurance_id,omitempty" url:"insurance_id,omitempty"` PaymentMethod string `json:"payment_method,omitempty" url:"payment_method,omitempty"` RecipientName string `json:"recipient_name,omitempty" url:"recipient_name,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` RequestedAmount string `json:"requested_amount,omitempty" url:"requested_amount,omitempty"` SalvageValue string `json:"salvage_value,omitempty" url:"salvage_value,omitempty"` ShipmentId string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` StatusDetail string `json:"status_detail,omitempty" url:"status_detail,omitempty"` StatusTimestamp string `json:"status_timestamp,omitempty" url:"status_timestamp,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` }
A Claim object represents a claim against insurance on a package.
type ClaimHistoryEntry ¶
type Client ¶
type Client struct { // BaseURL specifies the location of the API. It is used with // ResolveReference to create request URLs. (If 'Path' is specified, it // should end with a trailing slash.) If nil, the default will be used. BaseURL *url.URL // Client is an HTTP client used to make API requests. If nil, // http.DefaultClient will be used. Client *http.Client // APIKey is the user's API key. It is required. // Note: Treat your API Keys as passwords—keep them secret. API Keys give // full read/write access to your account, so they should not be included in // public repositories, emails, client side code, etc. APIKey string // UserAgent is a User-Agent to be sent with API HTTP requests. If empty, // a default will be used. UserAgent string // Timeout specifies the time limit (in milliseconds) for requests made by this Client. The // timeout includes connection time, any redirects, and reading the // response body. Timeout int // MockRequests is a list of requests that will be mocked by the client. MockRequests []MockRequest // Hooks is a collection of HookEventSubscriber instances for various hooks available in the client Hooks Hooks }
A Client provides an HTTP client for EasyPost API operations.
func (*Client) AddReferralCustomerBankAccountFromStripe ¶
func (c *Client) AddReferralCustomerBankAccountFromStripe(referralCustomerApiKey string, paymentMethodId string, mandateData *MandateData, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerBankAccountFromStripe adds a credit card to EasyPost for a ReferralCustomer with a payment method ID from Stripe. This function requires the ReferralCustomer User's API key.
func (*Client) AddReferralCustomerBankAccountFromStripeWithContext ¶
func (c *Client) AddReferralCustomerBankAccountFromStripeWithContext(ctx context.Context, referralCustomerApiKey string, financialConnectionsId string, mandateData *MandateData, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerBankAccountFromStripeWithContext performs the same operation as AddReferralCustomerBankAccountFromStripe, but allows specifying a context that can interrupt the request.
func (*Client) AddReferralCustomerCreditCard ¶
func (c *Client) AddReferralCustomerCreditCard(referralCustomerApiKey string, creditCardOptions *CreditCardOptions, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerCreditCard adds a credit card to EasyPost for a ReferralCustomer without needing a Stripe account.
func (*Client) AddReferralCustomerCreditCardFromStripe ¶
func (c *Client) AddReferralCustomerCreditCardFromStripe(referralCustomerApiKey string, paymentMethodId string, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerCreditCardFromStripe adds a credit card to EasyPost for a ReferralCustomer with a payment method ID from Stripe. This function requires the ReferralCustomer User's API key.
func (*Client) AddReferralCustomerCreditCardFromStripeWithContext ¶
func (c *Client) AddReferralCustomerCreditCardFromStripeWithContext(ctx context.Context, referralCustomerApiKey string, paymentMethodId string, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerCreditCardFromStripeWithContext performs the same operation as AddReferralCustomerCreditCardFromStripe, but allows specifying a context that can interrupt the request.
func (*Client) AddReferralCustomerCreditCardWithContext ¶
func (c *Client) AddReferralCustomerCreditCardWithContext(ctx context.Context, referralCustomerApiKey string, creditCardOptions *CreditCardOptions, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerCreditCardWithContext performs the same operation as AddReferralCustomerCreditCard, but allows specifying a context that can interrupt the request.
func (*Client) AddShipmentsToBatch ¶
func (c *Client) AddShipmentsToBatch(batchID string, shipments ...*Shipment) (out *Batch, err error)
AddShipmentsToBatch adds shipments to an existing batch, and returns the updated batch object.
func (*Client) AddShipmentsToBatchWithContext ¶
func (c *Client) AddShipmentsToBatchWithContext(ctx context.Context, batchID string, shipments ...*Shipment) (out *Batch, err error)
AddShipmentsToBatchWithContext performs the same operation as AddShipmentsToBatch, but allows specifying a context that can interrupt the request.
func (*Client) BetaAddPaymentMethod ¶
func (c *Client) BetaAddPaymentMethod(stripeCustomerId string, paymentMethodReference string, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
BetaAddPaymentMethod adds Stripe payment method to referral customer.
func (*Client) BetaAddPaymentMethodWithContext ¶
func (c *Client) BetaAddPaymentMethodWithContext(ctx context.Context, stripeCustomerId string, paymentMethodReference string, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
BetaAddPaymentMethodWithContext performs the same operation as BetaAddPaymentMethod, but allows specifying a context that can interrupt the request.
func (*Client) BetaCreateBankAccountClientSecret ¶
BetaCreateBankAccountClientSecret creates a client secret to use with Stripe when adding a bank account.
func (*Client) BetaCreateBankAccountClientSecretWithContext ¶
func (c *Client) BetaCreateBankAccountClientSecretWithContext(ctx context.Context) (out *clientSecretResponse, err error)
BetaCreateBankAccountClientSecretWithContext performs the same operation as BetaCreateBankAccountClientSecret, but allows specifying a context that can interrupt the request.
func (*Client) BetaCreateBankAccountClientSecretWithReturlUrl ¶
func (c *Client) BetaCreateBankAccountClientSecretWithReturlUrl(returnUrl string) (out *clientSecretResponse, err error)
BetaCreateBankAccountClientSecretWithReturlUrl creates a client secret to use with Stripe when adding a bank account.
func (*Client) BetaCreateBankAccountClientSecretWithReturnUrlWithContext ¶
func (c *Client) BetaCreateBankAccountClientSecretWithReturnUrlWithContext(ctx context.Context, returnUrl string) (out *clientSecretResponse, err error)
BetaCreateBankAccountClientSecretWithReturnUrlWithContext performs the same operation as BetaCreateBankAccountClientSecretWithReturlUrl, but allows specifying a context that can interrupt the request.
func (*Client) BetaCreateCreditCardClientSecret ¶
BetaCreateCreditCardClientSecret creates a client secret to use with Stripe when adding a credit card.
func (*Client) BetaCreateCreditCardClientSecretWithContext ¶
func (c *Client) BetaCreateCreditCardClientSecretWithContext(ctx context.Context) (out *clientSecretResponse, err error)
BetaCreateCreditCardClientSecretWithContext performs the same operation as BetaCreateCreditCardClientSecret, but allows specifying a context that can interrupt the request.
func (*Client) BetaGetStatelessRates ¶
func (c *Client) BetaGetStatelessRates(in *Shipment) (out []*StatelessRate, err error)
BetaGetStatelessRates fetches a list of stateless rates.
func (*Client) BetaGetStatelessRatesWithContext ¶
func (c *Client) BetaGetStatelessRatesWithContext(ctx context.Context, in *Shipment) (out []*StatelessRate, err error)
BetaGetStatelessRatesWithContext performs the same operation as BetaGetStatelessRates, but allows specifying a context that can interrupt the request.
func (*Client) BetaRefundByAmount ¶
func (c *Client) BetaRefundByAmount(refundAmount int) (out *BetaPaymentRefund, err error)
BetaRefundByAmount refunds a recent payment by amount in cents.
func (*Client) BetaRefundByAmountWithContext ¶
func (c *Client) BetaRefundByAmountWithContext(ctx context.Context, refundAmount int) (out *BetaPaymentRefund, err error)
BetaRefundByAmountWithContext performs the same operation as BetaRefundByAmount, but allows specifying a context that can interrupt the request.
func (*Client) BetaRefundByPaymentLog ¶
func (c *Client) BetaRefundByPaymentLog(paymentLogId string) (out *BetaPaymentRefund, err error)
BetaRefundByPaymentLog refunds a payment by payment log ID.
func (*Client) BetaRefundByPaymentLogWithContext ¶
func (c *Client) BetaRefundByPaymentLogWithContext(ctx context.Context, paymentLogId string) (out *BetaPaymentRefund, err error)
BetaRefundByPaymentLogWithContext performs the same operation as BetaRefundByPaymentLog, but allows specifying a context that can interrupt the request.
func (*Client) BuyBatch ¶
BuyBatch initializes purchases for the shipments in the batch. The updated batch object is returned.
func (*Client) BuyBatchWithContext ¶
BuyBatchWithContext performs the same operation as BuyBatch, but allows specifying a context that can interrupt the request.
func (*Client) BuyLumaShipment ¶ added in v5.2.0
func (c *Client) BuyLumaShipment(shipmentID string, in *LumaRequest) (out *Shipment, err error)
BuyLumaShipment buys a Shipment using Luma.
func (*Client) BuyLumaShipmentWithContext ¶ added in v5.2.0
func (c *Client) BuyLumaShipmentWithContext(ctx context.Context, shipmentID string, in *LumaRequest) (out *Shipment, err error)
BuyLumaShipmentWithContext performs the same operation as BuyLumaShipment, but allows specifying a context that can interrupt the request.
func (*Client) BuyOrder ¶
BuyOrder purchases an order. This operation populates the TrackingCode and PostageLabel attributes of each Shipment.
c := easypost.New(MyEasyPostAPIKey) out, err := c.Buy("order_1", "FedEx", "FEDEX_GROUND")
func (*Client) BuyOrderWithContext ¶
func (c *Client) BuyOrderWithContext(ctx context.Context, orderID, carrier, service string) (out *Order, err error)
BuyOrderWithContext performs the same operation as GBuyOrder, but allows specifying a context that can interrupt the request.
func (*Client) BuyPickup ¶
func (c *Client) BuyPickup(pickupID string, rate *PickupRate) (out *Pickup, err error)
BuyPickup purchases and schedules a pickup.
c := easypost.New(MyEasyPostAPIKey) rate := &PickupRate{Carrier: "UPS", Service: "Same-Day Pickup"} out, err := c.BuyPickup("pck_1", rate)
func (*Client) BuyPickupWithContext ¶
func (c *Client) BuyPickupWithContext(ctx context.Context, pickupID string, rate *PickupRate) (out *Pickup, err error)
BuyPickupWithContext performs the same operation as BuyPickup, but allows specifying a context that can interrupt the request.
func (*Client) BuyShipment ¶
func (c *Client) BuyShipment(shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
BuyShipment purchases a shipment. If successful, the returned Shipment will have the PostageLabel attribute populated.
c := easypost.New(MyEasyPostAPIKey) out, err := c.Buy("shp_100", &easypost.Rate{ID: "rate_1001"}, "249.99")
func (*Client) BuyShipmentWithContext ¶
func (c *Client) BuyShipmentWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
BuyShipmentWithContext performs the same operation as BuyShipment, but allows specifying a context that can interrupt the request.
func (*Client) BuyShipmentWithEndShipper ¶
func (c *Client) BuyShipmentWithEndShipper(shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
BuyShipmentWithEndShipper performs the same operation as BuyShipment, but includes an EndShipper ID.
func (*Client) BuyShipmentWithEndShipperWithContext ¶
func (c *Client) BuyShipmentWithEndShipperWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
BuyShipmentWithEndShipperWithContext performs the same operation as BuyShipmentWithEndShipper, but allows specifying a context that can interrupt the request.
func (*Client) CancelClaim ¶
CancelClaim refunds the Claim object with the given ID.
func (*Client) CancelClaimWithContext ¶
func (c *Client) CancelClaimWithContext(ctx context.Context, claimID string) (out *Claim, err error)
CancelClaimWithContext performs the same operation as CancelClaim, but allows specifying a context that can interrupt the request.
func (*Client) CancelPickup ¶
CancelPickup cancels a scheduled pickup.
func (*Client) CancelPickupWithContext ¶
func (c *Client) CancelPickupWithContext(ctx context.Context, pickupID string) (out *Pickup, err error)
CancelPickupWithContext performs the same operation as CancelPickup, but allows specifying a context that can interrupt the request.
func (*Client) CreateAddress ¶
func (c *Client) CreateAddress(in *Address, opts *CreateAddressOptions) (out *Address, err error)
CreateAddress submits a request to create a new address, and returns the result.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateAddress( &easypost.Address{ Street1: "417 Montgomery Street", Street2: "Floor 5", City: "San Francisco", State: "CA", Zip: "94104", Country: "US", Company: "EasyPost", Phone: "415-123-4567", }, &CreateAddressOptions{Verify: []string{"delivery"}}, )
func (*Client) CreateAddressWithContext ¶
func (c *Client) CreateAddressWithContext(ctx context.Context, in *Address, opts *CreateAddressOptions) (out *Address, err error)
CreateAddressWithContext performs the same operation as CreateAddress, but allows specifying a context that can interrupt the request.
func (*Client) CreateAndBuyLumaShipment ¶ added in v5.2.0
func (c *Client) CreateAndBuyLumaShipment(in *LumaRequest) (out *Shipment, err error)
CreateAndBuyLumaShipment creates and buys a Shipment using Luma.
func (*Client) CreateAndBuyLumaShipmentWithContext ¶ added in v5.2.0
func (c *Client) CreateAndBuyLumaShipmentWithContext(ctx context.Context, in *LumaRequest) (out *Shipment, err error)
CreateAndBuyLumaShipmentWithContext performs the same operation as CreateAndBuyLumaShipment, but allows specifying a context that can interrupt the request.
func (*Client) CreateAndVerifyAddress ¶
func (c *Client) CreateAndVerifyAddress(in *Address, opts *CreateAddressOptions) (out *Address, err error)
CreateAndVerifyAddress Create Address object and immediately verify it.
func (*Client) CreateAndVerifyAddressWithContext ¶
func (c *Client) CreateAndVerifyAddressWithContext(ctx context.Context, in *Address, opts *CreateAddressOptions) (out *Address, err error)
CreateAndVerifyAddressWithContext performs the same operation as CreateAndVerifyAddress, but allows specifying a context that can interrupt the request.
func (*Client) CreateBatch ¶
CreateBatch creates a new batch of shipments. It optionally accepts one or more shipments to add to the new batch. If successful, a new batch object is returned.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateBatch( &easypost.Shipment{ID: "shp_100"}, &easypost.Shipment{ID: "shp_101"}, &easypost.Shipment{ID: "shp_102"}, )
func (*Client) CreateBatchScanForms ¶
CreateBatchScanForms generates a scan form for the batch.
func (*Client) CreateBatchScanFormsWithContext ¶
func (c *Client) CreateBatchScanFormsWithContext(ctx context.Context, batchID, format string) (out *Batch, err error)
CreateBatchScanFormsWithContext performs the same operation as CreateBatchScanForms, but allows specifying a context that can interrupt the request.
func (*Client) CreateBatchWithContext ¶
func (c *Client) CreateBatchWithContext(ctx context.Context, in ...*Shipment) (out *Batch, err error)
CreateBatchWithContext performs the same operation as CreateBatch, but allows specifying a context that can interrupt the request.
func (*Client) CreateCarrierAccount ¶
func (c *Client) CreateCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
CreateCarrierAccount creates a new carrier account. It can only be used with a production API key.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateCarrierAccount( &easypost.CarrierAccount{ Type: "DhlEcsAccount", Description: "CA Location DHL eCommerce Solutions Account", Credentials: map[string]string{ "client_id": "123456", "client_secret": "123abc", "distribution_center": "USLAX1", "pickup_id": "123456", }, TestCredentials: map[string]string{ "client_id": "123456", "client_secret": "123abc", "distribution_center": "USLAX1", "pickup_id": "123456", }, }, )
Users cannot create UPS accounts with this function, must use CreateUpsCarrierAccount. An error will be returned if the user tries to create a UPS account with this function.
func (*Client) CreateCarrierAccountWithContext ¶
func (c *Client) CreateCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
CreateCarrierAccountWithContext performs the same operation as CreateCarrierAccount, but allows specifying a context that can interrupt the request. Users cannot create UPS accounts with this function, must use CreateUpsCarrierAccount. An error will be returned if the user tries to create a UPS account with this function.
func (*Client) CreateClaim ¶
func (c *Client) CreateClaim(in *CreateClaimParameters) (out *Claim, err error)
CreateClaim creates a Claim object for insurance purchased through EasyPost.
func (*Client) CreateClaimWithContext ¶
func (c *Client) CreateClaimWithContext(ctx context.Context, in *CreateClaimParameters) (out *Claim, err error)
CreateClaimWithContext performs the same operation as CreateClaim, but allows specifying a context that can interrupt the request.
func (*Client) CreateCustomsInfo ¶
func (c *Client) CreateCustomsInfo(in *CustomsInfo) (out *CustomsInfo, err error)
CreateCustomsInfo creates a new CustomsInfo object.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateCustomsInfo( &easypost.CustomsInfo{ CustomsCertify: true, CustomsSigner: "Steve Brule", CustomsType: "merchandise", RestrictionType: "none", EELPFC: "NOEEI 30.37(a)", CustomsItems: []*easypost.CustomsItem{ &easypost.CustomsItem{ID: "cstitem_2002"}, &easypost.CustomsItem{ Description: "Sweet shirts", Quantity: 2, Value: 23, Weight: 11, HSTariffNumber: "654321", OriginCountry: "US", }, }, }, )
func (*Client) CreateCustomsInfoWithContext ¶
func (c *Client) CreateCustomsInfoWithContext(ctx context.Context, in *CustomsInfo) (out *CustomsInfo, err error)
CreateCustomsInfoWithContext performs the same operation as CreateCustomsInfo, but allows specifying a context that can interrupt the request.
func (*Client) CreateCustomsItem ¶
func (c *Client) CreateCustomsItem(in *CustomsItem) (out *CustomsItem, err error)
CreateCustomsItem creates a new CustomsItem object.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateCustomsItem( &easypost.CustomsItem{ Description: "T-shirt", Quantity: 1, Weight: 5, Value: 10, HSTariffNumber: "123456", OriginCountry: "US", }, )
func (*Client) CreateCustomsItemWithContext ¶
func (c *Client) CreateCustomsItemWithContext(ctx context.Context, in *CustomsItem) (out *CustomsItem, err error)
CreateCustomsItemWithContext performs the same operation as CreateCustomsItem, but allows specifying a context that can interrupt the request.
func (*Client) CreateEndShipper ¶
CreateEndShipper submits a request to create a new endshipper, and returns the result.
func (*Client) CreateEndShipperWithContext ¶
func (c *Client) CreateEndShipperWithContext(ctx context.Context, in *Address) (out *Address, err error)
CreateEndShipperWithContext performs the same operation as CreateEndShipper, but allows specifying a context that can interrupt the request.
func (*Client) CreateInsurance ¶
CreateInsurance creates an insurance object for a shipment purchased outside EasyPost. ToAddress, FromAddress, TrackingCode and Amount fields must be provided. Providing a value in the Carrier field is optional, but can help avoid ambiguity and provide a shorter response time.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateInsurance( &easypost.Insurance{ ToAddress: &easypost.Address{ID: "adr_102"}, FromAddress: &easypost.Address{ID: "adr_101"}, TrackingCode: "9400110898825022579493", Carrier: "USPS", Reference: "insuranceRef1", Amount: 100, )
func (*Client) CreateInsuranceWithContext ¶
func (c *Client) CreateInsuranceWithContext(ctx context.Context, in *Insurance) (out *Insurance, err error)
CreateInsuranceWithContext performs the same operation as CreateInsurance, but allows specifying a context that can interrupt the request.
func (*Client) CreateOauthCarrierAccount ¶
func (c *Client) CreateOauthCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
CreateOauthCarrierAccount creates a new carrier account that uses Oauth. It can only be used with a production API key. Users cannot create non-oauth accounts with this function, must use CreateCarrierAccount. An error will be returned if the user tries to create a non-oauth account with this function.
func (*Client) CreateOauthCarrierAccountWithContext ¶
func (c *Client) CreateOauthCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
CreateOauthCarrierAccountWithContext performs the same operation as CreateOauthCarrierAccount, but allows specifying a context that can interrupt the request. Users cannot create non-oauth accounts with this function, must use CreateCarrierAccount. An error will be returned if the user tries to create a non-oauth account with this function.
func (*Client) CreateOrder ¶
func (c *Client) CreateOrder(in *Order, accounts ...*CarrierAccount) (out *Order, err error)
CreateOrder creates a new order object. If the `accounts` parameter is given, the provided carrier accounts will be used to limit the returned rates to the given carrier(s).
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateOrder( &easypost.Order{ ToAddress: &easypost.Address{ID: "adr_1001"}, FromAddress: &easypost.Address{Id: "adr_101"}, Shipments: []*easypost.Shipment{ &easypost.Shipment{ Parcel: &easypost.Parcel{ PredefinedPackage: "FedExBox", Weight: 10.2, }, }, &easypost.Shipment{ Parcel: &easypost.Parcel{ PredefinedPackage: "FedExBox", Weight: 17.5, }, }, }, }, &easypost.CarrierAccount{ID: "ca_101"}, &easypost.CarrierAccount{ID: "ca_102"}, )
func (*Client) CreateOrderWithContext ¶
func (c *Client) CreateOrderWithContext(ctx context.Context, in *Order, accounts ...*CarrierAccount) (out *Order, err error)
CreateOrderWithContext performs the same operation as CreateOrder, but allows specifying a context that can interrupt the request.
func (*Client) CreateParcel ¶
CreateParcel creates a new Parcel object.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateParcel( &easypost.Parcel{ Length: 20.2, Width: 10.9, Height: 5, Weight: 65.9, }, )
func (*Client) CreateParcelWithContext ¶
CreateParcelWithContext performs the same operation as CreateParcel, but allows specifying a context that can interrupt the request.
func (*Client) CreatePickup ¶
CreatePickup creates a new Pickup object, and automatically fetches rates for the given time and location.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreatePickup( &easypost.Pickup{ Reference: "my-first-pickup", MinDatetime: time.Date(2014, 10, 21, 0, 10, 0, 0, time.UTC), MaxDatetime: time.Date(2014, 10, 21, 15, 30, 0, 0, time.UTC), Shipment: &easypost.Shipment{ID: "shp_1"}, Address: &easypost.Address{ID: "ad_1001"}, IsAccountAddress: false, Instructions: "Special pickup instructions", }, )
func (*Client) CreatePickupWithContext ¶
CreatePickupWithContext performs the same operation as CreatePickup, but allows specifying a context that can interrupt the request.
func (*Client) CreateReferralCustomer ¶
func (c *Client) CreateReferralCustomer(in *UserOptions) (out *ReferralCustomer, err error)
CreateReferralCustomer creates a new referral customer.
func (*Client) CreateReferralCustomerWithContext ¶
func (c *Client) CreateReferralCustomerWithContext(ctx context.Context, in *UserOptions) (out *ReferralCustomer, err error)
CreateReferralCustomerWithContext performs the same operation as CreateReferralCustomer, but allows specifying a context that can interrupt the request.
func (*Client) CreateRefund ¶
CreateRefund submits a refund request and return a list of refunds.
func (*Client) CreateRefundWithContext ¶
func (c *Client) CreateRefundWithContext(ctx context.Context, in map[string]interface{}) (out []*Refund, err error)
CreateRefundWithContext performs the same operation as CreateRefund, but allows specifying a context that can interrupt the request.
func (*Client) CreateReport ¶
CreateReport generates a new report. Valid Fields for input are StartDate, EndDate and SendEmail. A new Report object is returned. Once the Status is available, the report can be downloaded from the provided URL for 30 seconds.
c := easypost.New(MyEasyPostAPIKey) c.CreateReport( "payment_log", &easypost.Report{StartDate: "2016-10-01", EndDate: "2016-10-31"}, )
func (*Client) CreateReportWithContext ¶
func (c *Client) CreateReportWithContext(ctx context.Context, typ string, in *Report) (out *Report, err error)
CreateReportWithContext performs the same operation as CreateReport, but allows specifying a context that can interrupt the request.
func (*Client) CreateScanForm ¶
CreateScanForm creates a scan form for the given Shipments.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateScanForm("shp_1", "shp_2")
func (*Client) CreateScanFormWithContext ¶
func (c *Client) CreateScanFormWithContext(ctx context.Context, shipmentIDs ...string) (out *ScanForm, err error)
CreateScanFormWithContext performs the same operation as CreateScanForm, but allows specifying a context that can interrupt the request.
func (*Client) CreateShipment ¶
CreateShipment creates a new Shipment object. The ToAddress, FromAddress and Parcel attributes are required. These objects may be fully-specified to create new ones at the same time as creating the Shipment, or they can refer to existing objects via their ID attribute. Passing in one or more carrier accounts to CreateShipment limits the returned rates to the specified carriers.
c := easypost.New(MyEasyPostAPIKey) out, err := c.CreateShipment( &easypost.Shipment{ ToAddress: &easypost.Address{ Name: "Dr. Steve Brule", Street1: "179 N Harbor Dr", City: "Redondo Beach", State: "CA", Zip: "90277", Country: "US", Phone: "8573875756", Email: "dr_steve_brule@gmail.com", }, FromAddress: &easypost.Address{ID: "adr_101"}, Parcel: &easypost.Parcel{ Length: 20.2, Width: 10.9, Height: 5, Weight: 65.9, }, CustomsInfo: &easypost.CustomsInfo{ID: "cstinfo_1"}, }, )
func (*Client) CreateShipmentWithContext ¶
func (c *Client) CreateShipmentWithContext(ctx context.Context, in *Shipment) (out *Shipment, err error)
CreateShipmentWithContext performs the same operation as CreateShipment, but allows specifying a context that can interrupt the request.
func (*Client) CreateTracker ¶
func (c *Client) CreateTracker(opts *CreateTrackerOptions) (out *Tracker, err error)
CreateTracker creates a new Tracker object with the provided options. Providing a carrier is optional, but helps to avoid ambiguity in detecting the carrier based on the tracking code format.
func (*Client) CreateTrackerWithContext ¶
func (c *Client) CreateTrackerWithContext(ctx context.Context, opts *CreateTrackerOptions) (out *Tracker, err error)
CreateTrackerWithContext performs the same operation as CreateTracker, but allows specifying a context that can interrupt the request.
func (*Client) CreateUpsCarrierAccount ¶
func (c *Client) CreateUpsCarrierAccount(in *UpsCarrierAccountCreationParameters) (out *CarrierAccount, err error)
CreateUpsCarrierAccount creates a new UPS carrier account. It can only be used with a production API key. Users cannot create non-UPS accounts with this function, must use CreateCarrierAccount. An error will be returned if the user tries to create a non-UPS account with this function.
func (*Client) CreateUpsCarrierAccountWithContext ¶
func (c *Client) CreateUpsCarrierAccountWithContext(ctx context.Context, in *UpsCarrierAccountCreationParameters) (out *CarrierAccount, err error)
CreateUpsCarrierAccountWithContext performs the same operation as CreateUpsCarrierAccount, but allows specifying a context that can interrupt the request. Users cannot create non-UPS accounts with this function, must use CreateCarrierAccount. An error will be returned if the user tries to create a non-UPS account with this function.
func (*Client) CreateUser ¶
func (c *Client) CreateUser(in *UserOptions) (out *User, err error)
CreateUser creates a new child user.
c := easypost.New(MyEasyPostAPIKey) opts := &easypost.UserOptions{Name: easypost.StringPtr("Child User")} out, err := c.CreateUser(opts)
func (*Client) CreateUserWithContext ¶
CreateUserWithContext performs the same operation as CreateUser, but allows specifying a context that can interrupt the request.
func (*Client) CreateWebhook ¶
func (c *Client) CreateWebhook(data *CreateUpdateWebhookOptions) (out *Webhook, err error)
CreateWebhook creates a new webhook with the provided details.
func (*Client) CreateWebhookWithContext ¶
func (c *Client) CreateWebhookWithContext(ctx context.Context, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
CreateWebhookWithContext performs the same operation as CreateWebhook, but allows specifying a context that can interrupt the request.
func (*Client) DeleteCarrierAccount ¶
DeleteCarrierAccount removes the carrier account with the given ID.
func (*Client) DeleteCarrierAccountWithContext ¶
func (c *Client) DeleteCarrierAccountWithContext(ctx context.Context, carrierAccountID string) error
DeleteCarrierAccountWithContext performs the same operation as DeleteCarrierAccount, but allows specifying a context that can interrupt the request.
func (*Client) DeletePaymentMethod ¶
func (c *Client) DeletePaymentMethod(priority PaymentMethodPriority) (err error)
DeletePaymentMethod allows you to delete a payment method in your wallet.
func (*Client) DeletePaymentMethodWithContext ¶
func (c *Client) DeletePaymentMethodWithContext(ctx context.Context, priority PaymentMethodPriority) (err error)
DeletePaymentMethodWithContext performs the same as DeletePaymentMethod, but allows specifying a context that can interrupt the request.
func (*Client) DeleteUser ¶
DeleteUser removes a child user.
func (*Client) DeleteUserWithContext ¶
DeleteUserWithContext performs the same operation as DeleteUser, but allows specifying a context that can interrupt the request.
func (*Client) DeleteWebhook ¶
DeleteWebhook removes a webhook.
func (*Client) DeleteWebhookWithContext ¶
DeleteWebhookWithContext performs the same operation as DeleteWebhook, but allows specifying a context that can interrupt the request.
func (*Client) EstimateDeliveryDateForZipPair ¶
func (c *Client) EstimateDeliveryDateForZipPair(params *EstimateDeliveryDateForZipPairParams) (out *EstimateDeliveryDateForZipPairResult, err error)
EstimateDeliveryDateForZipPair retrieves the estimated delivery date of each carrier-service level combination via the Smart Deliver By API, based on a specific ship date and origin-destination postal code pair.
func (*Client) EstimateDeliveryDateForZipPairWithContext ¶
func (c *Client) EstimateDeliveryDateForZipPairWithContext(ctx context.Context, params *EstimateDeliveryDateForZipPairParams) (out *EstimateDeliveryDateForZipPairResult, err error)
EstimateDeliveryDateForZipPairWithContext performs the same operation as EstimateDeliveryDateForZipPair, but allows specifying a context that can interrupt the request.
func (*Client) FundWallet ¶
func (c *Client) FundWallet(amount string, priority PaymentMethodPriority) (err error)
FundWallet allows you to fund your EasyPost wallet by charging your primary or secondary payment method on file.
func (*Client) FundWalletWithContext ¶
func (c *Client) FundWalletWithContext(ctx context.Context, amount string, priority PaymentMethodPriority) (err error)
FundWalletWithContext performs the same as FundWallet, but allows specifying a context that can interrupt the request.
func (*Client) GenerateShipmentForm ¶
func (c *Client) GenerateShipmentForm(shipmentID string, formType string) (out *Shipment, err error)
GenerateShipmentForm generates a form of a given type for a shipment
func (*Client) GenerateShipmentFormWithContext ¶
func (c *Client) GenerateShipmentFormWithContext(ctx context.Context, shipmentID string, formType string) (out *Shipment, err error)
GenerateShipmentFormWithContext performs the same operation as GenerateShipmentForm, but allows specifying a context that can interrupt the request.
func (*Client) GenerateShipmentFormWithOptions ¶
func (c *Client) GenerateShipmentFormWithOptions(shipmentID string, formType string, formOptions map[string]interface{}) (out *Shipment, err error)
GenerateShipmentFormWithOptions generates a form of a given type for a shipment, using provided options
func (*Client) GenerateShipmentFormWithOptionsWithContext ¶
func (c *Client) GenerateShipmentFormWithOptionsWithContext(ctx context.Context, shipmentID string, formType string, formOptions map[string]interface{}) (out *Shipment, err error)
GenerateShipmentFormWithOptionsWithContext performs the same operation as GenerateShipmentFormWithOptions, but allows specifying a context that can interrupt the request.
func (*Client) GetAPIKeys ¶
GetAPIKeys returns the list of API keys associated with the current user.
func (*Client) GetAPIKeysForUser ¶
GetAPIKeysForUser returns the list of API keys associated with the given user ID.
func (*Client) GetAPIKeysForUserWithContext ¶
func (c *Client) GetAPIKeysForUserWithContext(ctx context.Context, userID string) (out *APIKeys, err error)
GetAPIKeysForUserWithContext performs the same operation as GetAPIKeysForUser, but allows specifying a context that can interrupt the request.
func (*Client) GetAPIKeysWithContext ¶
GetAPIKeysWithContext performs the same operation as GetAPIKeys, but allows specifying a context that can interrupt the request.
func (*Client) GetAddress ¶
GetAddress retrieves a previously-created address by its ID.
func (*Client) GetAddressWithContext ¶
func (c *Client) GetAddressWithContext(ctx context.Context, addressID string) (out *Address, err error)
GetAddressWithContext performs the same operation as GetAddress, but allows specifying a context that can interrupt the request.
func (*Client) GetBatchLabels ¶
GetBatchLabels generates a label for the batch. This can only be done once per batch, and all shipments must have a "postage_purchased" status.
func (*Client) GetBatchLabelsWithContext ¶
func (c *Client) GetBatchLabelsWithContext(ctx context.Context, batchID, format string) (out *Batch, err error)
GetBatchLabelsWithContext performs the same operation as GetBatchLabels, but allows specifying a context that can interrupt the request.
func (*Client) GetBatchWithContext ¶
GetBatchWithContext performs the same operation as GetBatch, but allows specifying a context that can interrupt the request.
func (*Client) GetCarrierAccount ¶
func (c *Client) GetCarrierAccount(carrierAccountID string) (out *CarrierAccount, err error)
GetCarrierAccount retrieves a carrier account by its ID or reference.
func (*Client) GetCarrierAccountWithContext ¶
func (c *Client) GetCarrierAccountWithContext(ctx context.Context, carrierAccountID string) (out *CarrierAccount, err error)
GetCarrierAccountWithContext performs the same operation as GetCarrierAccount, but allows specifying a context that can interrupt the request.
func (*Client) GetCarrierMetadata ¶
func (c *Client) GetCarrierMetadata() (out []*CarrierMetadata, err error)
GetCarrierMetadata retrieves all metadata for all carriers on the EasyPost platform.
func (*Client) GetCarrierMetadataWithCarriers ¶
func (c *Client) GetCarrierMetadataWithCarriers(carriers []string) (out []*CarrierMetadata, err error)
GetCarrierMetadataWithCarriers retrieves carrier metadata for a list of carriers.
func (*Client) GetCarrierMetadataWithCarriersAndTypes ¶
func (c *Client) GetCarrierMetadataWithCarriersAndTypes(carriers []string, types []string) (out []*CarrierMetadata, err error)
GetCarrierMetadataWithCarriersAndTypes retrieves carrier metadata for a list of carriers and a list of types.
func (*Client) GetCarrierMetadataWithContext ¶
func (c *Client) GetCarrierMetadataWithContext(ctx context.Context, carriers []string, types []string) (out []*CarrierMetadata, err error)
GetCarrierMetadataWithContext performs the same operation as GetCarrierMetadata, but allows specifying a context that can interrupt the request.
func (*Client) GetCarrierMetadataWithTypes ¶
func (c *Client) GetCarrierMetadataWithTypes(types []string) (out []*CarrierMetadata, err error)
GetCarrierMetadataWithTypes retrieves carrier metadata for a list of carriers.
func (*Client) GetCarrierTypes ¶
func (c *Client) GetCarrierTypes() (out []*CarrierType, err error)
GetCarrierTypes returns a list of supported carrier types for the current user.
func (*Client) GetCarrierTypesWithContext ¶
func (c *Client) GetCarrierTypesWithContext(ctx context.Context) (out []*CarrierType, err error)
GetCarrierTypesWithContext performs the same operation as GetCarrierTypes, but allows specifying a context that can interrupt the request.
func (*Client) GetClaimWithContext ¶
GetClaimWithContext performs the same operation as GetClaim, but allows specifying a context that can interrupt the request.
func (*Client) GetCustomsInfo ¶
func (c *Client) GetCustomsInfo(customsInfoID string) (out *CustomsInfo, err error)
GetCustomsInfo returns the CustomsInfo object with the given ID or reference.
func (*Client) GetCustomsInfoWithContext ¶
func (c *Client) GetCustomsInfoWithContext(ctx context.Context, customsInfoID string) (out *CustomsInfo, err error)
GetCustomsInfoWithContext performs the same operation as GetCustomsInfo, but allows specifying a context that can interrupt the request.
func (*Client) GetCustomsItem ¶
func (c *Client) GetCustomsItem(customsItemID string) (out *CustomsItem, err error)
GetCustomsItem returns the CustomsInfo object with the given ID or reference.
func (*Client) GetCustomsItemWithContext ¶
func (c *Client) GetCustomsItemWithContext(ctx context.Context, customsItemID string) (out *CustomsItem, err error)
GetCustomsItemWithContext performs the same operation as GetCustomsItem, but allows specifying a context that can interrupt the request.
func (*Client) GetEndShipper ¶
GetEndShipper retrieves a previously created endshipper by its ID.
func (*Client) GetEndShipperWithContext ¶
func (c *Client) GetEndShipperWithContext(ctx context.Context, endshipperID string) (out *Address, err error)
GetEndShipperWithContext performs the same operation as GetEndShipper, but allows specifying a context that can interrupt the request.
func (*Client) GetEventPayload ¶
func (c *Client) GetEventPayload(eventID, payloadID string) (out *EventPayload, err error)
GetEventPayload retrieves a specific payload result of a previous webhook call.
func (*Client) GetEventPayloadWithContext ¶
func (c *Client) GetEventPayloadWithContext(ctx context.Context, eventID, payloadID string) (out *EventPayload, err error)
GetEventPayloadWithContext performs the same operation as GetEventPayload, but allows specifying a context that can interrupt the request.
func (*Client) GetEventWithContext ¶
GetEventWithContext performs the same operation as GetEvent, but allows specifying a context that can interrupt the request.
func (*Client) GetInsurance ¶
GetInsurance returns the Insurance object with the given ID or reference.
func (*Client) GetInsuranceWithContext ¶
func (c *Client) GetInsuranceWithContext(ctx context.Context, insuranceID string) (out *Insurance, err error)
GetInsuranceWithContext performs the same operation as GetInsurance, but allows specifying a context that can interrupt the request.
func (*Client) GetLumaPromise ¶ added in v5.2.0
func (c *Client) GetLumaPromise(in *LumaRequest) (out *LumaInfo, err error)
GetLumaPromise retrieves the Luma AI Promise for a given shipment.
func (*Client) GetLumaPromiseWithContext ¶ added in v5.2.0
func (c *Client) GetLumaPromiseWithContext(ctx context.Context, in *LumaRequest) (out *LumaInfo, err error)
GetLumaPromiseWithContext performs the same operation as GetLumaPromise, but allows specifying a context that can interrupt the request.
func (*Client) GetNextAddressPage ¶
func (c *Client) GetNextAddressPage(collection *ListAddressResult) (out *ListAddressResult, err error)
GetNextAddressPage returns the next page of addresses
func (*Client) GetNextAddressPageWithContext ¶
func (c *Client) GetNextAddressPageWithContext(ctx context.Context, collection *ListAddressResult) (out *ListAddressResult, err error)
GetNextAddressPageWithContext performs the same operation as GetNextAddressPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextAddressPageWithPageSize ¶
func (c *Client) GetNextAddressPageWithPageSize(collection *ListAddressResult, pageSize int) (out *ListAddressResult, err error)
GetNextAddressPageWithPageSize returns the next page of addresses with a specific page size
func (*Client) GetNextAddressPageWithPageSizeWithContext ¶
func (c *Client) GetNextAddressPageWithPageSizeWithContext(ctx context.Context, collection *ListAddressResult, pageSize int) (out *ListAddressResult, err error)
GetNextAddressPageWithPageSizeWithContext performs the same operation as GetNextAddressPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextChildUserPage ¶
func (c *Client) GetNextChildUserPage(collection *ListChildUsersResult) (out *ListChildUsersResult, err error)
GetNextChildUserPage returns the next page of child users.
func (*Client) GetNextChildUserPageWithContext ¶
func (c *Client) GetNextChildUserPageWithContext(ctx context.Context, collection *ListChildUsersResult) (out *ListChildUsersResult, err error)
GetNextChildUserPageWithContext performs the same operation as GetNextChildUserPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextChildUserPageWithPageSize ¶
func (c *Client) GetNextChildUserPageWithPageSize(collection *ListChildUsersResult, pageSize int) (out *ListChildUsersResult, err error)
GetNextChildUserPageWithPageSize returns the next page of child users with a specific page size.
func (*Client) GetNextChildUserPageWithPageSizeWithContext ¶
func (c *Client) GetNextChildUserPageWithPageSizeWithContext(ctx context.Context, collection *ListChildUsersResult, pageSize int) (out *ListChildUsersResult, err error)
GetNextChildUserPageWithPageSizeWithContext performs the same operation as GetNextChildUserPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextClaimPage ¶
func (c *Client) GetNextClaimPage(collection *ListClaimsResult) (out *ListClaimsResult, err error)
GetNextClaimPage returns the next page of claims
func (*Client) GetNextClaimPageWithContext ¶
func (c *Client) GetNextClaimPageWithContext(ctx context.Context, collection *ListClaimsResult) (out *ListClaimsResult, err error)
GetNextClaimPageWithContext performs the same operation as GetNextClaimPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextClaimPageWithPageSize ¶
func (c *Client) GetNextClaimPageWithPageSize(collection *ListClaimsResult, pageSize int) (out *ListClaimsResult, err error)
GetNextClaimPageWithPageSize returns the next page of claims with a specific page size
func (*Client) GetNextClaimPageWithPageSizeWithContext ¶
func (c *Client) GetNextClaimPageWithPageSizeWithContext(ctx context.Context, collection *ListClaimsResult, pageSize int) (out *ListClaimsResult, err error)
GetNextClaimPageWithPageSizeWithContext performs the same operation as GetNextClaimPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextEventPage ¶
func (c *Client) GetNextEventPage(collection *ListEventsResult) (out *ListEventsResult, err error)
GetNextEventPage returns the next page of events
func (*Client) GetNextEventPageWithContext ¶
func (c *Client) GetNextEventPageWithContext(ctx context.Context, collection *ListEventsResult) (out *ListEventsResult, err error)
GetNextEventPageWithContext performs the same operation as GetNextEventPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextEventPageWithPageSize ¶
func (c *Client) GetNextEventPageWithPageSize(collection *ListEventsResult, pageSize int) (out *ListEventsResult, err error)
GetNextEventPageWithPageSize returns the next page of events with a specific page size
func (*Client) GetNextEventPageWithPageSizeWithContext ¶
func (c *Client) GetNextEventPageWithPageSizeWithContext(ctx context.Context, collection *ListEventsResult, pageSize int) (out *ListEventsResult, err error)
GetNextEventPageWithPageSizeWithContext performs the same operation as GetNextEventPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextInsurancePage ¶
func (c *Client) GetNextInsurancePage(collection *ListInsurancesResult) (out *ListInsurancesResult, err error)
GetNextInsurancePage returns the next page of insurance records
func (*Client) GetNextInsurancePageWithContext ¶
func (c *Client) GetNextInsurancePageWithContext(ctx context.Context, collection *ListInsurancesResult) (out *ListInsurancesResult, err error)
GetNextInsurancePageWithContext performs the same operation as GetNextInsurancePage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextInsurancePageWithPageSize ¶
func (c *Client) GetNextInsurancePageWithPageSize(collection *ListInsurancesResult, pageSize int) (out *ListInsurancesResult, err error)
GetNextInsurancePageWithPageSize returns the next page of insurance records with a specific page size
func (*Client) GetNextInsurancePageWithPageSizeWithContext ¶
func (c *Client) GetNextInsurancePageWithPageSizeWithContext(ctx context.Context, collection *ListInsurancesResult, pageSize int) (out *ListInsurancesResult, err error)
GetNextInsurancePageWithPageSizeWithContext performs the same operation as GetNextInsurancePageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextPickupPage ¶
func (c *Client) GetNextPickupPage(collection *ListPickupResult) (out *ListPickupResult, err error)
GetNextPickupPage returns the next page of pickups
func (*Client) GetNextPickupPageWithContext ¶
func (c *Client) GetNextPickupPageWithContext(ctx context.Context, collection *ListPickupResult) (out *ListPickupResult, err error)
GetNextPickupPageWithContext performs the same operation as GetNextPickupPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextPickupPageWithPageSize ¶
func (c *Client) GetNextPickupPageWithPageSize(collection *ListPickupResult, pageSize int) (out *ListPickupResult, err error)
GetNextPickupPageWithPageSize returns the next page of pickups with a specific page size
func (*Client) GetNextPickupPageWithPageSizeWithContext ¶
func (c *Client) GetNextPickupPageWithPageSizeWithContext(ctx context.Context, collection *ListPickupResult, pageSize int) (out *ListPickupResult, err error)
GetNextPickupPageWithPageSizeWithContext performs the same operation as GetNextPickupPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextReferralCustomerPage ¶
func (c *Client) GetNextReferralCustomerPage(collection *ListReferralCustomersResult) (out *ListReferralCustomersResult, err error)
GetNextReferralCustomerPage returns the next page of referral customers
func (*Client) GetNextReferralCustomerPageWithContext ¶
func (c *Client) GetNextReferralCustomerPageWithContext(ctx context.Context, collection *ListReferralCustomersResult) (out *ListReferralCustomersResult, err error)
GetNextReferralCustomerPageWithContext performs the same operation as GetNextReferralCustomerPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextReferralCustomerPageWithPageSize ¶
func (c *Client) GetNextReferralCustomerPageWithPageSize(collection *ListReferralCustomersResult, pageSize int) (out *ListReferralCustomersResult, err error)
GetNextReferralCustomerPageWithPageSize returns the next page of referral customers with a specific page size
func (*Client) GetNextReferralCustomerPageWithPageSizeWithContext ¶
func (c *Client) GetNextReferralCustomerPageWithPageSizeWithContext(ctx context.Context, collection *ListReferralCustomersResult, pageSize int) (out *ListReferralCustomersResult, err error)
GetNextReferralCustomerPageWithPageSizeWithContext performs the same operation as GetNextReferralCustomerPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextRefundPage ¶
func (c *Client) GetNextRefundPage(collection *ListRefundResult) (out *ListRefundResult, err error)
GetNextRefundPage returns the next page of refunds
func (*Client) GetNextRefundPageWithContext ¶
func (c *Client) GetNextRefundPageWithContext(ctx context.Context, collection *ListRefundResult) (out *ListRefundResult, err error)
GetNextRefundPageWithContext performs the same operation as GetNextRefundPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextRefundPageWithPageSize ¶
func (c *Client) GetNextRefundPageWithPageSize(collection *ListRefundResult, pageSize int) (out *ListRefundResult, err error)
GetNextRefundPageWithPageSize returns the next page of refunds with a specific page size
func (*Client) GetNextRefundPageWithPageSizeWithContext ¶
func (c *Client) GetNextRefundPageWithPageSizeWithContext(ctx context.Context, collection *ListRefundResult, pageSize int) (out *ListRefundResult, err error)
GetNextRefundPageWithPageSizeWithContext performs the same operation as GetNextRefundPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextReportPage ¶
func (c *Client) GetNextReportPage(collection *ListReportsResult) (out *ListReportsResult, err error)
GetNextReportPage returns the next page of reports
func (*Client) GetNextReportPageWithContext ¶
func (c *Client) GetNextReportPageWithContext(ctx context.Context, collection *ListReportsResult) (out *ListReportsResult, err error)
GetNextReportPageWithContext performs the same operation as GetNextReportPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextReportPageWithPageSize ¶
func (c *Client) GetNextReportPageWithPageSize(collection *ListReportsResult, pageSize int) (out *ListReportsResult, err error)
GetNextReportPageWithPageSize returns the next page of reports with a specific page size
func (*Client) GetNextReportPageWithPageSizeWithContext ¶
func (c *Client) GetNextReportPageWithPageSizeWithContext(ctx context.Context, collection *ListReportsResult, pageSize int) (out *ListReportsResult, err error)
GetNextReportPageWithPageSizeWithContext performs the same operation as GetNextReportPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextScanFormPage ¶
func (c *Client) GetNextScanFormPage(collection *ListScanFormsResult) (out *ListScanFormsResult, err error)
GetNextScanFormPage returns the next page of scan forms
func (*Client) GetNextScanFormPageWithContext ¶
func (c *Client) GetNextScanFormPageWithContext(ctx context.Context, collection *ListScanFormsResult) (out *ListScanFormsResult, err error)
GetNextScanFormPageWithContext performs the same operation as GetNextScanFormPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextScanFormPageWithPageSize ¶
func (c *Client) GetNextScanFormPageWithPageSize(collection *ListScanFormsResult, pageSize int) (out *ListScanFormsResult, err error)
GetNextScanFormPageWithPageSize returns the next page of scan forms with a specific page size
func (*Client) GetNextScanFormPageWithPageSizeWithContext ¶
func (c *Client) GetNextScanFormPageWithPageSizeWithContext(ctx context.Context, collection *ListScanFormsResult, pageSize int) (out *ListScanFormsResult, err error)
GetNextScanFormPageWithPageSizeWithContext performs the same operation as GetNextScanFormPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextShipmentPage ¶
func (c *Client) GetNextShipmentPage(collection *ListShipmentsResult) (out *ListShipmentsResult, err error)
GetNextShipmentPage returns the next page of shipments
func (*Client) GetNextShipmentPageWithContext ¶
func (c *Client) GetNextShipmentPageWithContext(ctx context.Context, collection *ListShipmentsResult) (out *ListShipmentsResult, err error)
GetNextShipmentPageWithContext performs the same operation as GetNextShipmentPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextShipmentPageWithPageSize ¶
func (c *Client) GetNextShipmentPageWithPageSize(collection *ListShipmentsResult, pageSize int) (out *ListShipmentsResult, err error)
GetNextShipmentPageWithPageSize returns the next page of shipments with a specific page size
func (*Client) GetNextShipmentPageWithPageSizeWithContext ¶
func (c *Client) GetNextShipmentPageWithPageSizeWithContext(ctx context.Context, collection *ListShipmentsResult, pageSize int) (out *ListShipmentsResult, err error)
GetNextShipmentPageWithPageSizeWithContext performs the same operation as GetNextShipmentPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetNextTrackerPage ¶
func (c *Client) GetNextTrackerPage(collection *ListTrackersResult) (out *ListTrackersResult, err error)
GetNextTrackerPage returns the next page of trackers
func (*Client) GetNextTrackerPageWithContext ¶
func (c *Client) GetNextTrackerPageWithContext(ctx context.Context, collection *ListTrackersResult) (out *ListTrackersResult, err error)
GetNextTrackerPageWithContext performs the same operation as GetNextTrackerPage, but allows specifying a context that can interrupt the request.
func (*Client) GetNextTrackerPageWithPageSize ¶
func (c *Client) GetNextTrackerPageWithPageSize(collection *ListTrackersResult, pageSize int) (out *ListTrackersResult, err error)
GetNextTrackerPageWithPageSize returns the next page of trackers with a specific page size
func (*Client) GetNextTrackerPageWithPageSizeWithContext ¶
func (c *Client) GetNextTrackerPageWithPageSizeWithContext(ctx context.Context, collection *ListTrackersResult, pageSize int) (out *ListTrackersResult, err error)
GetNextTrackerPageWithPageSizeWithContext performs the same operation as GetNextTrackerPageWithPageSize, but allows specifying a context that can interrupt the request.
func (*Client) GetOrderRates ¶
GetOrderRates refreshes rates for an Order.
func (*Client) GetOrderRatesWithContext ¶
func (c *Client) GetOrderRatesWithContext(ctx context.Context, orderID string) (out *Order, err error)
GetOrderRatesWithContext performs the same operation as GetOrderRates, but allows specifying a context that can interrupt the request.
func (*Client) GetOrderWithContext ¶
GetOrderWithContext performs the same operation as GetOrder, but allows specifying a context that can interrupt the request.
func (*Client) GetParcelWithContext ¶
func (c *Client) GetParcelWithContext(ctx context.Context, parcelID string) (out *Parcel, err error)
GetParcelWithContext performs the same operation as GetParcel, but allows specifying a context that can interrupt the request.
func (*Client) GetPaymentEndpointByPrimaryOrSecondary ¶
func (c *Client) GetPaymentEndpointByPrimaryOrSecondary(primaryOrSecondary PaymentMethodPriority) (out string)
GetPaymentEndpointByPrimaryOrSecondary gets the payment priority based on primaryOrSecondary parameter.
func (*Client) GetPickupWithContext ¶
func (c *Client) GetPickupWithContext(ctx context.Context, pickupID string) (out *Pickup, err error)
GetPickupWithContext performs the same operation as GetPickup, but allows specifying a context that can interrupt the request.
func (*Client) GetRateWithContext ¶
GetRateWithContext performs the same operation as GetRate, but allows specifying a context that can interrupt the request.
func (*Client) GetRefundWithContext ¶
func (c *Client) GetRefundWithContext(ctx context.Context, refundID string) (out *Refund, err error)
GetRefundWithContext performs the same operation as GetRefund, but allows specifying a context that can interrupt the request.
func (*Client) GetReportWithContext ¶
func (c *Client) GetReportWithContext(ctx context.Context, typ, reportID string) (out *Report, err error)
GetReportWithContext performs the same operation as GetReport, but allows specifying a context that can interrupt the request.
func (*Client) GetScanForm ¶
GetScanForm retrieves a ScanForm object by ID.
func (*Client) GetScanFormWithContext ¶
func (c *Client) GetScanFormWithContext(ctx context.Context, scanFormID string) (out *ScanForm, err error)
GetScanFormWithContext performs the same operation as GetScanForm, but allows specifying a context that can interrupt the request.
func (*Client) GetShipment ¶
GetShipment retrieves a Shipment object by ID.
func (*Client) GetShipmentEstimatedDeliveryDate ¶
func (c *Client) GetShipmentEstimatedDeliveryDate(shipmentID string, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
GetShipmentEstimatedDeliveryDate retrieves the estimated delivery date of each rate for a Shipment via the Delivery Date Estimator API, based on a specific ship date.
func (*Client) GetShipmentEstimatedDeliveryDateWithContext ¶
func (c *Client) GetShipmentEstimatedDeliveryDateWithContext(ctx context.Context, shipmentID string, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
GetShipmentEstimatedDeliveryDateWithContext performs the same operation as EstimateDeliveryDateForShipment, but allows specifying a context that can interrupt the request.
func (*Client) GetShipmentLabel ¶
GetShipmentLabel enables retrieving the label for a shipment in a different format. The PostageLabel field in the returned Shipment object will reflect the new format.
func (*Client) GetShipmentLabelWithContext ¶
func (c *Client) GetShipmentLabelWithContext(ctx context.Context, shipmentID, format string) (out *Shipment, err error)
GetShipmentLabelWithContext performs the same operation as GetShipmentLabel, but allows specifying a context that can interrupt the request.
func (*Client) GetShipmentSmartrates ¶
GetShipmentSmartrates fetches the available smartrates for a shipment.
func (*Client) GetShipmentSmartratesWithContext ¶
func (c *Client) GetShipmentSmartratesWithContext(ctx context.Context, shipmentID string) (out []*SmartRate, err error)
GetShipmentSmartratesWithContext performs the same operation as GetShipmentRates, but allows specifying a context that can interrupt the request.
func (*Client) GetShipmentWithContext ¶
func (c *Client) GetShipmentWithContext(ctx context.Context, shipmentID string) (out *Shipment, err error)
GetShipmentWithContext performs the same operation as GetShipment, but allows specifying a context that can interrupt the request.
func (*Client) GetTracker ¶
GetTracker retrieves a Tracker object by ID.
func (*Client) GetTrackerWithContext ¶
func (c *Client) GetTrackerWithContext(ctx context.Context, trackerID string) (out *Tracker, err error)
GetTrackerWithContext performs the same operation as GetTracker, but allows specifying a context that can interrupt the request.
func (*Client) GetUserWithContext ¶
GetUserWithContext performs the same operation as GetUser, but allows specifying a context that can interrupt the request.
func (*Client) GetWebhook ¶
GetWebhook retrieves a Webhook object with the given ID.
func (*Client) GetWebhookWithContext ¶
func (c *Client) GetWebhookWithContext(ctx context.Context, webhookID string) (out *Webhook, err error)
GetWebhookWithContext performs the same operation as GetWebhook, but allows specifying a context that can interrupt the request.
func (*Client) InsureShipment ¶
InsureShipment purchases insurance for the shipment. Insurance should be purchased after purchasing the shipment, but before it has been processed by the carrier. On success, the purchased insurance will be reflected in the returned Shipment object's Insurance field.
func (*Client) InsureShipmentWithContext ¶
func (c *Client) InsureShipmentWithContext(ctx context.Context, shipmentID, amount string) (out *Shipment, err error)
InsureShipmentWithContext performs the same operation as InsureShipment, but allows specifying a context that can interrupt the request.
func (*Client) ListAddresses ¶
func (c *Client) ListAddresses(opts *ListOptions) (out *ListAddressResult, err error)
ListAddresses provides a paginated result of Address objects.
func (*Client) ListAddressesWithContext ¶
func (c *Client) ListAddressesWithContext(ctx context.Context, opts *ListOptions) (out *ListAddressResult, err error)
ListAddressesWithContext performs the same operation as ListAddresses, but allows specifying a context that can interrupt the request.
func (*Client) ListBatches ¶
func (c *Client) ListBatches(opts *ListOptions) (out *ListBatchesResult, err error)
ListBatches provides a paginated result of Insurance objects.
func (*Client) ListBatchesWithContext ¶
func (c *Client) ListBatchesWithContext(ctx context.Context, opts *ListOptions) (out *ListBatchesResult, err error)
ListBatchesWithContext performs the same operation as ListBatches, but allows specifying a context that can interrupt the request.
func (*Client) ListCarrierAccounts ¶
func (c *Client) ListCarrierAccounts() (out []*CarrierAccount, err error)
ListCarrierAccounts returns a list of all carrier accounts available to the authenticated account.
func (*Client) ListCarrierAccountsWithContext ¶
func (c *Client) ListCarrierAccountsWithContext(ctx context.Context) (out []*CarrierAccount, err error)
ListCarrierAccountsWithContext performs the same operation as ListCarrierAccounts, but allows specifying a context that can interrupt the request.
func (*Client) ListChildUsers ¶
func (c *Client) ListChildUsers(opts *ListOptions) (out *ListChildUsersResult, err error)
ListChildUsers retrieves a list of child users.
func (*Client) ListChildUsersWithContext ¶
func (c *Client) ListChildUsersWithContext(ctx context.Context, opts *ListOptions) (out *ListChildUsersResult, err error)
ListChildUsersWithContext performs the same operation as ListChildUsers, but allows specifying a context that can interrupt the request.
func (*Client) ListClaims ¶
func (c *Client) ListClaims(opts *ListClaimsParameters) (out *ListClaimsResult, err error)
ListClaims provides a paginated result of Claim objects.
func (*Client) ListClaimsWithContext ¶
func (c *Client) ListClaimsWithContext(ctx context.Context, opts *ListClaimsParameters) (out *ListClaimsResult, err error)
ListClaimsWithContext performs the same operation as ListClaims, but allows specifying a context that can interrupt the request.
func (*Client) ListEndShippers ¶
func (c *Client) ListEndShippers(opts *ListOptions) (out *ListEndShipperResult, err error)
ListEndShippers provides a paginated result of EndShipper objects.
func (*Client) ListEndShippersWithContext ¶
func (c *Client) ListEndShippersWithContext(ctx context.Context, opts *ListOptions) (out *ListEndShipperResult, err error)
ListEndShippersWithContext performs the same operation as ListEndShippers, but allows specifying a context that can interrupt the request.
func (*Client) ListEventPayloads ¶
func (c *Client) ListEventPayloads(eventID string) (out []*EventPayload, err error)
ListEventPayloads retrieves the payload results of a previous webhook call.
func (*Client) ListEventPayloadsWithContext ¶
func (c *Client) ListEventPayloadsWithContext(ctx context.Context, eventID string) (out []*EventPayload, err error)
ListEventPayloadsWithContext performs the same operation as GetEventPayload, but allows specifying a context that can interrupt the request.
func (*Client) ListEvents ¶
func (c *Client) ListEvents(opts *ListOptions) (out *ListEventsResult, err error)
ListEvents provides a paginated result of Event objects.
func (*Client) ListEventsWithContext ¶
func (c *Client) ListEventsWithContext(ctx context.Context, opts *ListOptions) (out *ListEventsResult, err error)
ListEventsWithContext performs the same operation as ListEvents, but allows specifying a context that can interrupt the request.
func (*Client) ListInsurances ¶
func (c *Client) ListInsurances(opts *ListOptions) (out *ListInsurancesResult, err error)
ListInsurances provides a paginated result of Insurance objects.
func (*Client) ListInsurancesWithContext ¶
func (c *Client) ListInsurancesWithContext(ctx context.Context, opts *ListOptions) (out *ListInsurancesResult, err error)
ListInsurancesWithContext performs the same operation as ListInsurances, but allows specifying a context that can interrupt the request.
func (*Client) ListPickups ¶
func (c *Client) ListPickups(opts *ListOptions) (out *ListPickupResult, err error)
ListPickups provides a paginated result of Pickup objects.
func (*Client) ListPickupsWithContext ¶
func (c *Client) ListPickupsWithContext(ctx context.Context, opts *ListOptions) (out *ListPickupResult, err error)
ListPickupsWithContext performs the same operation as ListPickups, but allows specifying a context that can interrupt the request.
func (*Client) ListReferralCustomers ¶
func (c *Client) ListReferralCustomers(opts *ListOptions) (out *ListReferralCustomersResult, err error)
ListReferralCustomers provides a paginated result of ReferralCustomer objects.
func (*Client) ListReferralCustomersWithContext ¶
func (c *Client) ListReferralCustomersWithContext(ctx context.Context, opts *ListOptions) (out *ListReferralCustomersResult, err error)
ListReferralCustomersWithContext performs the same operation as ListReferralCustomers, but allows specifying a context that can interrupt the request.
func (*Client) ListRefunds ¶
func (c *Client) ListRefunds(opts *ListOptions) (out *ListRefundResult, err error)
ListRefunds provides a paginated result of Refund objects.
func (*Client) ListRefundsWithContext ¶
func (c *Client) ListRefundsWithContext(ctx context.Context, opts *ListOptions) (out *ListRefundResult, err error)
ListRefundsWithContext performs the same operation as ListRefunds, but allows specifying a context that can interrupt the request.
func (*Client) ListReports ¶
func (c *Client) ListReports(typ string, opts *ListOptions) (out *ListReportsResult, err error)
ListReports provides a paginated result of Report objects of the given type.
func (*Client) ListReportsWithContext ¶
func (c *Client) ListReportsWithContext(ctx context.Context, typ string, opts *ListOptions) (out *ListReportsResult, err error)
ListReportsWithContext performs the same operation as ListReports, but allows specifying a context that can interrupt the request.
func (*Client) ListScanForms ¶
func (c *Client) ListScanForms(opts *ListOptions) (out *ListScanFormsResult, err error)
ListScanForms provides a paginated result of ScanForm objects.
func (*Client) ListScanFormsWithContext ¶
func (c *Client) ListScanFormsWithContext(ctx context.Context, opts *ListOptions) (out *ListScanFormsResult, err error)
ListScanFormsWithContext performs the same operation as ListScanForms, but allows specifying a context that can interrupt the request.
func (*Client) ListShipments ¶
func (c *Client) ListShipments(opts *ListShipmentsOptions) (out *ListShipmentsResult, err error)
ListShipments provides a paginated result of Shipment objects.
func (*Client) ListShipmentsWithContext ¶
func (c *Client) ListShipmentsWithContext(ctx context.Context, opts *ListShipmentsOptions) (out *ListShipmentsResult, err error)
ListShipmentsWithContext performs the same operation as ListShipments, but allows specifying a context that can interrupt the request.
func (*Client) ListTrackers ¶
func (c *Client) ListTrackers(opts *ListTrackersOptions) (out *ListTrackersResult, err error)
ListTrackers provides a paginated result of Tracker objects.
func (*Client) ListTrackersWithContext ¶
func (c *Client) ListTrackersWithContext(ctx context.Context, opts *ListTrackersOptions) (out *ListTrackersResult, err error)
ListTrackersWithContext performs the same operation as ListTrackers, but allows specifying a context that can interrupt the request.
func (*Client) ListWebhooks ¶
ListWebhooks returns all webhooks associated with the EasyPost account.
func (*Client) ListWebhooksWithContext ¶
ListWebhooksWithContext performs the same operation as ListWebhooksWithContext, but allows specifying a context that can interrupt the request.
func (*Client) LowestOrderRate ¶
LowestOrderRate gets the lowest rate of an order
func (*Client) LowestOrderRateWithCarrier ¶
LowestOrderRateWithCarrier performs the same operation as LowestOrderRate, but allows specifying a list of carriers for the lowest rate
func (*Client) LowestOrderRateWithCarrierAndService ¶
func (c *Client) LowestOrderRateWithCarrierAndService(order *Order, carriers []string, services []string) (out Rate, err error)
LowestOrderRateWithCarrierAndService performs the same operation as LowestOrderRate, but allows specifying a list of carriers and service for the lowest rate
func (*Client) LowestPickupRate ¶
func (c *Client) LowestPickupRate(pickup *Pickup) (out PickupRate, err error)
LowestPickupRate gets the lowest rate of a pickup
func (*Client) LowestPickupRateWithCarrier ¶
func (c *Client) LowestPickupRateWithCarrier(pickup *Pickup, carriers []string) (out PickupRate, err error)
LowestPickupRateWithCarrier performs the same operation as LowestPickupRate, but allows specifying a list of carriers for the lowest rate
func (*Client) LowestPickupRateWithCarrierAndService ¶
func (c *Client) LowestPickupRateWithCarrierAndService(pickup *Pickup, carriers []string, services []string) (out PickupRate, err error)
LowestPickupRateWithCarrierAndService performs the same operation as LowestPickupRate, but allows specifying a list of carriers and service for the lowest rate
func (*Client) LowestShipmentRate ¶
LowestShipmentRate gets the lowest rate of a shipment
func (*Client) LowestShipmentRateWithCarrier ¶
func (c *Client) LowestShipmentRateWithCarrier(shipment *Shipment, carriers []string) (out Rate, err error)
LowestShipmentRateWithCarrier performs the same operation as LowestShipmentRate, but allows specifying a list of carriers for the lowest rate
func (*Client) LowestShipmentRateWithCarrierAndService ¶
func (c *Client) LowestShipmentRateWithCarrierAndService(shipment *Shipment, carriers []string, services []string) (out Rate, err error)
LowestShipmentRateWithCarrierAndService performs the same operation as LowestShipmentRate, but allows specifying a list of carriers and service for the lowest rate
func (*Client) LowestSmartrate ¶
func (c *Client) LowestSmartrate(shipment *Shipment, deliveryDays int, deliveryAccuracy string) (out SmartRate, err error)
LowestSmartrate gets the lowest smartrate of a shipment with the specified delivery days and accuracy
func (*Client) LowestStatelessRate ¶
func (c *Client) LowestStatelessRate(rates []*StatelessRate) (out StatelessRate, err error)
LowestStatelessRate gets the lowest stateless rate from a list of stateless rates
func (*Client) LowestStatelessRateWithCarrier ¶
func (c *Client) LowestStatelessRateWithCarrier(rates []*StatelessRate, carriers []string) (out StatelessRate, err error)
LowestStatelessRateWithCarrier performs the same operation as LowestStatelessRate, but allows specifying a list of carriers for the lowest rate
func (*Client) LowestStatelessRateWithCarrierAndService ¶
func (c *Client) LowestStatelessRateWithCarrierAndService(rates []*StatelessRate, carriers []string, services []string) (out StatelessRate, err error)
LowestStatelessRateWithCarrierAndService performs the same operation as LowestStatelessRate, but allows specifying a list of carriers and service for the lowest rate
func (*Client) RecommendShipDateForShipment ¶
func (c *Client) RecommendShipDateForShipment(shipmentID string, desiredDeliveryDate string) (out []*RecommendShipDateForShipmentResult, err error)
RecommendShipDateForShipment retrieves the recommended ship date of each rate for a Shipment via the Precision Shipping API, based on a specific desired delivery date.
func (*Client) RecommendShipDateForShipmentWithContext ¶
func (c *Client) RecommendShipDateForShipmentWithContext(ctx context.Context, shipmentID string, desiredDeliveryDate string) (out []*RecommendShipDateForShipmentResult, err error)
RecommendShipDateForShipmentWithContext performs the same operation as RecommendShipDateForShipment, but allows specifying a context that can interrupt the request.
func (*Client) RecommendShipDateForZipPair ¶
func (c *Client) RecommendShipDateForZipPair(params *RecommendShipDateForZipPairParams) (out *RecommendShipDateForZipPairResult, err error)
RecommendShipDateForZipPair retrieves the recommended ship date of each carrier-service level combination via the Smart Deliver On API, based on a specific desired delivery date and origin-destination postal code pair.
func (*Client) RecommendShipDateForZipPairWithContext ¶
func (c *Client) RecommendShipDateForZipPairWithContext(ctx context.Context, params *RecommendShipDateForZipPairParams) (out *RecommendShipDateForZipPairResult, err error)
RecommendShipDateForZipPairWithContext performs the same operation as RecommendShipDateForZipPair, but allows specifying a context that can interrupt the request.
func (*Client) RefundInsurance ¶
RefundInsurance refunds the Insurance object with the given ID.
func (*Client) RefundInsuranceWithContext ¶
func (c *Client) RefundInsuranceWithContext(ctx context.Context, insuranceID string) (out *Insurance, err error)
RefundInsuranceWithContext performs the same operation as RefundInsurance, but allows specifying a context that can interrupt the request.
func (*Client) RefundShipment ¶
RefundShipment requests a refund from the carrier.
func (*Client) RefundShipmentWithContext ¶
func (c *Client) RefundShipmentWithContext(ctx context.Context, shipmentID string) (out *Shipment, err error)
RefundShipmentWithContext performs the same operation as RefundShipment, but allows specifying a context that can interrupt the request.
func (*Client) RemoveShipmentsFromBatch ¶
func (c *Client) RemoveShipmentsFromBatch(batchID string, shipments ...*Shipment) (out *Batch, err error)
RemoveShipmentsFromBatch removes shipments from an existing batch, and returns the updated batch object.
func (*Client) RemoveShipmentsFromBatchWithContext ¶
func (c *Client) RemoveShipmentsFromBatchWithContext(ctx context.Context, batchID string, shipments ...*Shipment) (out *Batch, err error)
RemoveShipmentsFromBatchWithContext performs the same operation as RemoveShipmentsFromBatch, but allows specifying a context that can interrupt the request.
func (*Client) RerateShipment ¶
RerateShipment fetches the available rates for a shipment with the current rates.
func (*Client) RerateShipmentWithContext ¶
func (c *Client) RerateShipmentWithContext(ctx context.Context, shipmentID string) (out []*Rate, err error)
RerateShipmentWithContext performs the same operation as RerateShipment, but allows specifying a context that can interrupt the request.
func (*Client) RetrieveMe ¶
RetrieveMe retrieves the current user.
func (*Client) RetrieveMeWithContext ¶
RetrieveMeWithContext performs the same operation as RetrieveMe, but allows specifying a context that can interrupt the request.
func (*Client) RetrievePaymentMethods ¶
func (c *Client) RetrievePaymentMethods() (out *PaymentMethod, err error)
RetrievePaymentMethods returns the payment methods associated with the current user.
func (*Client) RetrievePaymentMethodsWithContext ¶
func (c *Client) RetrievePaymentMethodsWithContext(ctx context.Context) (out *PaymentMethod, err error)
RetrievePaymentMethodsWithContext performs the same as RetrievePaymentMethods, but allows specifying a context that can interrupt the request.
func (*Client) UpdateBrand ¶
UpdateBrand updates the user brand.
func (*Client) UpdateBrandWithContext ¶
func (c *Client) UpdateBrandWithContext(ctx context.Context, userID string, params map[string]interface{}) (out *Brand, err error)
UpdateBrandWithContext performs the same operation as UpdateBrand, but allows specifying a context that can interrupt the request.
func (*Client) UpdateCarrierAccount ¶
func (c *Client) UpdateCarrierAccount(in *CarrierAccount) (out *CarrierAccount, err error)
UpdateCarrierAccount updates the carrier account. Only the Description, Reference, Credentials and TestCredentials attributes can be updated.
c := easypost.New(MyEasyPostAPIKey) out, err := c.UpdateCarrierAccount( &easypost.CarrierAccount{ ID: "ca_...", Description: "FL Location DHL eCommerce Solutions Account", Credentials: map[string]string{ "pickup_id": "abc123", }, }, )
Users cannot update UPS accounts with this function, must use UpdateUpsCarrierAccount. An error will be returned if the user tries to update a UPS account with this function.
func (*Client) UpdateCarrierAccountWithContext ¶
func (c *Client) UpdateCarrierAccountWithContext(ctx context.Context, in *CarrierAccount) (out *CarrierAccount, err error)
UpdateCarrierAccountWithContext performs the same operation as UpdateCarrierAccount, but allows specifying a context that can interrupt the request. Users cannot update UPS accounts with this function, must use UpdateUpsCarrierAccount. An error will be returned if the user tries to update a UPS account with this function.
func (*Client) UpdateEndShippers ¶
UpdateEndShippers updates previously created endshipper
func (*Client) UpdateEndShippersWithContext ¶
func (c *Client) UpdateEndShippersWithContext(ctx context.Context, in *Address) (out *Address, err error)
UpdateEndShippersWithContext performs the same operation as UpdateEndShippers, but allows specifying a context that can interrupt the request.
func (*Client) UpdateReferralCustomerEmail ¶
func (c *Client) UpdateReferralCustomerEmail(userId string, email string) (out *ReferralCustomer, err error)
UpdateReferralCustomerEmail updates a ReferralCustomer's email address
func (*Client) UpdateReferralCustomerEmailWithContext ¶
func (c *Client) UpdateReferralCustomerEmailWithContext(ctx context.Context, userId string, email string) (out *ReferralCustomer, err error)
UpdateReferralCustomerEmailWithContext performs the same operation as UpdateReferralCustomerEmail, but allows specifying a context that can interrupt the request.
func (*Client) UpdateUpsCarrierAccount ¶
func (c *Client) UpdateUpsCarrierAccount(id string, in *UpsCarrierAccountUpdateParameters) (out *CarrierAccount, err error)
UpdateUpsCarrierAccount updates a UPS carrier account. Users cannot update non-UPS accounts with this function, must use UpdateCarrierAccount. An error will be returned if the user tries to update a non-UPS account with this function.
func (*Client) UpdateUpsCarrierAccountWithContext ¶
func (c *Client) UpdateUpsCarrierAccountWithContext(ctx context.Context, id string, in *UpsCarrierAccountUpdateParameters) (out *CarrierAccount, err error)
UpdateUpsCarrierAccountWithContext performs the same operation as UpdateUpsCarrierAccount, but allows specifying a context that can interrupt the request. Users cannot update non-UPS accounts with this function, must use UpdateCarrierAccount. An error will be returned if the user tries to update a non-UPS account with this function.
func (*Client) UpdateUser ¶
func (c *Client) UpdateUser(in *UserOptions) (out *User, err error)
UpdateUser updates a user with the attributes given in the UpdateUserOptions parameter. If the ID field of UpdateUserOptions is empty, the operation is done on the current user. All other fields are updated if they are non-nil.
func (*Client) UpdateUserWithContext ¶
UpdateUserWithContext performs the same operation as UpdateUser, but allows specifying a context that can interrupt the request.
func (*Client) UpdateWebhook ¶
func (c *Client) UpdateWebhook(webhookID string, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
UpdateWebhook updates a webhook. Automatically re-enables webhook if it is disabled.
func (*Client) UpdateWebhookWithContext ¶
func (c *Client) UpdateWebhookWithContext(ctx context.Context, webhookID string, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
UpdateWebhookWithContext performs the same operation as UpdateWebhook, but allows specifying a context that can interrupt the request.
func (*Client) ValidateWebhook ¶
func (c *Client) ValidateWebhook(eventBody []byte, headers map[string]interface{}, webhookSecret string) (out *Event, err error)
ValidateWebhook validates a webhook by comparing the HMAC signature header sent from EasyPost to your shared secret. If the signatures do not match, an error will be raised signifying the webhook either did not originate from EasyPost or the secrets do not match. If the signatures do match, the `event_body` will be returned as JSON.
func (*Client) ValidateWebhookWithContext ¶
func (c *Client) ValidateWebhookWithContext(ctx context.Context, eventBody []byte, headers map[string]interface{}, webhookSecret string) (out *Event, err error)
ValidateWebhookWithContext performs the same operation as ValidateWebhook, but allows specifying a context that can interrupt the request.
func (*Client) VerifyAddress ¶
VerifyAddress performs address verification.
type ConnectionError ¶
type ConnectionError struct {
APIError // subtype of APIError
}
ConnectionError is raised when the API returns a 0 status code.
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
Unwrap returns the underlying APIError error.
type CreateAddressOptions ¶
type CreateAddressOptions struct { Verify bool `json:"verify,omitempty" url:"verify,omitempty"` VerifyStrict bool `json:"verify_strict,omitempty" url:"verify_strict,omitempty"` }
CreateAddressOptions is used to specify verification options for address creation.
type CreateClaimParameters ¶
type CreateClaimParameters struct { TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Amount float64 `json:"amount,omitempty" url:"amount,omitempty"` EmailEvidenceAttachments []string `json:"email_evidence_attachments,omitempty" url:"email_evidence_attachments,omitempty"` InvoiceAttachments []string `json:"invoice_attachments,omitempty" url:"invoice_attachments,omitempty"` SupportingDocumentationAttachments []string `json:"supporting_documentation_attachments,omitempty" url:"supporting_documentation_attachments,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` RecipientName string `json:"recipient_name,omitempty" url:"recipient_name,omitempty"` ContactEmail string `json:"contact_email,omitempty" url:"contact_email,omitempty"` PaymentMethod string `json:"payment_method,omitempty" url:"payment_method,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` }
CreateClaimParameters is used to specify parameters for creating a claim.
type CreateTrackerOptions ¶
type CreateTrackerOptions struct { TrackingCode string Carrier string Amount string CarrierAccount string IsReturn bool }
CreateTrackerOptions specifies options for creating a new tracker.
type CreateUpdateWebhookOptions ¶
type CreateUpdateWebhookOptions struct { URL string `json:"url,omitempty" url:"url,omitempty"` WebhookSecret string `json:"webhook_secret,omitempty" url:"webhook_secret,omitempty"` CustomHeaders []WebhookCustomHeader `json:"custom_headers,omitempty" url:"custom_headers,omitempty"` }
CreateUpdateWebhookOptions is used to specify parameters for creating and updating EasyPost webhooks.
type CreditCardOptions ¶
type CreditCardOptions struct { Number string `json:"number,omitempty" url:"number,omitempty"` ExpMonth string `json:"expiration_month,omitempty" url:"expiration_month,omitempty"` ExpYear string `json:"expiration_year,omitempty" url:"expiration_year,omitempty"` Cvc string `json:"cvc,omitempty" url:"cvc,omitempty"` }
CreditCardOptions specifies options for creating or updating a credit card.
type CustomsInfo ¶
type CustomsInfo struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` EELPFC string `json:"eel_pfc,omitempty" url:"eel_pfc,omitempty"` ContentsType string `json:"contents_type,omitempty" url:"contents_type,omitempty"` ContentsExplanation string `json:"contents_explanation,omitempty" url:"contents_explanation,omitempty"` CustomsCertify bool `json:"customs_certify,omitempty" url:"customs_certify,omitempty"` CustomsSigner string `json:"customs_signer,omitempty" url:"customs_signer,omitempty"` NonDeliveryOption string `json:"non_delivery_option,omitempty" url:"non_delivery_option,omitempty"` RestrictionType string `json:"restriction_type,omitempty" url:"restriction_type,omitempty"` CustomsItems []*CustomsItem `json:"customs_items,omitempty" url:"customs_items,omitempty"` Declaration string `json:"declaration,omitempty" url:"declaration,omitempty"` }
CustomsInfo objects contain CustomsItem objects and all necessary information for the generation of customs forms required for international shipping.
type CustomsItem ¶
type CustomsItem struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Quantity float64 `json:"quantity,omitempty" url:"quantity,omitempty"` Value float64 `json:"value,omitempty,string" url:"value,omitempty"` Weight float64 `json:"weight,omitempty" url:"weight,omitempty"` HSTariffNumber string `json:"hs_tariff_number,omitempty" url:"hs_tariff_number,omitempty"` Code string `json:"code,omitempty" url:"code,omitempty"` OriginCountry string `json:"origin_country,omitempty" url:"origin_country,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` }
A CustomsItem object describes goods for international shipment.
type DateTime ¶
func DateTimeFromString ¶
func DateTimeFromTime ¶
DateTimeFromTime construct a DateTime from a time.Time
func NewDateTime ¶
func NewDateTime(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) DateTime
NewDateTime returns the DateTime corresponding to
yyyy-mm-dd hh:mm:ss + nsec nanoseconds
in the appropriate zone for that time in the given location.
The month, day, hour, min, sec, and nsec values may be outside their usual ranges and will be normalized during the conversion. For example, October 32 converts to November 1.
A daylight savings time transition skips or repeats times. For example, in the United States, March 13, 2011 2:15am never occurred, while November 6, 2011 1:15am occurred twice. In such cases, the choice of time zone, and therefore the time, is not well-defined. NewDateTime returns a time that is correct in one of the two zones involved in the transition, but it does not guarantee which.
NewDateTime panics if loc is nil.
func (*DateTime) EncodeValues ¶
EncodeValues implements the query.Encoder interface of how to encode the DateTime for a URL query string
func (*DateTime) MarshalJSON ¶
func (*DateTime) UnmarshalJSON ¶
type DeliveryDateForZipPairEstimate ¶
type DeliveryDateForZipPairEstimate struct { Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` EasyPostTimeInTransitData *TimeInTransitDetailsForDeliveryDate `json:"easypost_time_in_transit_data,omitempty" url:"easypost_time_in_transit_data,omitempty"` }
DeliveryDateForZipPairEstimate is a single zip-pair-based delivery date estimate for a carrier-service level combination.
type EasyPostTimeInTransitData ¶
type EasyPostTimeInTransitData struct { DaysInTransit TimeInTransit `json:"days_in_transit,omitempty" url:"days_in_transit,omitempty"` EasyPostEstimatedDeliveryDate string `json:"easypost_estimated_delivery_date,omitempty" url:"easypost_estimated_delivery_date,omitempty"` PlannedShipDate string `json:"planned_ship_date,omitempty" url:"planned_ship_date,omitempty"` }
type EndOfPaginationError ¶
type EndOfPaginationError struct {
LocalError // subtype of LocalError
}
EndOfPaginationError is raised when there are no more pages to retrieve.
func (*EndOfPaginationError) Unwrap ¶
func (e *EndOfPaginationError) Unwrap() error
Unwrap returns the underlying LocalError error.
type EstimateDeliveryDateForZipPairParams ¶
type EstimateDeliveryDateForZipPairParams struct { FromZip string `json:"from_zip,omitempty" url:"from_zip,omitempty"` ToZip string `json:"to_zip,omitempty" url:"to_zip,omitempty"` Carriers []string `json:"carriers,omitempty" url:"carriers,omitempty"` PlannedShipDate string `json:"planned_ship_date,omitempty" url:"planned_ship_date,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty" url:"saturday_delivery,omitempty"` }
EstimateDeliveryDateForZipPairParams are used in the EstimateDeliveryDateForZipPair method.
type EstimateDeliveryDateForZipPairResult ¶
type EstimateDeliveryDateForZipPairResult struct { CarriersWithoutEstimates []string `json:"carriers_without_tint_estimates,omitempty" url:"carriers_without_tint_estimates,omitempty"` FromZip string `json:"from_zip,omitempty" url:"from_zip,omitempty"` ToZip string `json:"to_zip,omitempty" url:"to_zip,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty" url:"saturday_delivery,omitempty"` PlannedShipDate *DateTime `json:"planned_ship_date,omitempty" url:"planned_ship_date,omitempty"` Results []*DeliveryDateForZipPairEstimate `json:"results,omitempty" url:"results,omitempty"` }
EstimateDeliveryDateForZipPairResult is the result of the EstimateDeliveryDateForZipPair method, containing the estimated delivery date of each carrier-service level combination and additional metadata.
type EstimatedDeliveryDate ¶
type EstimatedDeliveryDate struct { EasyPostTimeInTransitData EasyPostTimeInTransitData `json:"easypost_time_in_transit_data,omitempty" url:"easypost_time_in_transit_data,omitempty"` Rate SmartRate `json:"rate,omitempty" url:"rate,omitempty"` }
type Event ¶
type Event struct { ID string `json:"id,omitempty" url:"id,omitempty"` UserID string `json:"user_id,omitempty" url:"user_id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` PreviousAttributes map[string]interface{} `json:"previous_attributes,omitempty" url:"previous_attributes,omitempty"` // Result will be populated with the relevant object type, i.e. // *Batch, *Insurance, *PaymentLog, *Refund, *Report, *Tracker or *ScanForm. // It will be nil if no 'result' field is present, which is the case for // the ListEvents and GetEvents methods. The RequestBody field of the // EventPayload type will generally be an instance of *Event with this field // present. Having the field here also enables re-using this type to // implement a webhook handler. Result interface{} `json:"result,omitempty" url:"result,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` PendingURLs []string `json:"pending_urls,omitempty" url:"pending_urls,omitempty"` CompletedURLs []string `json:"completed_urls,omitempty" url:"completed_urls,omitempty"` }
Event objects contain details about changes to EasyPost objects
func (*Event) UnmarshalJSON ¶
UnmarshalJSON will attempt to convert an event response to an *Event type, but it may be set to a default type if decoding to an object fails.
type EventPayload ¶
type EventPayload struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` RequestURL string `json:"request_url,omitempty" url:"request_url,omitempty"` RequestHeaders map[string]string `json:"request_headers,omitempty" url:"request_headers,omitempty"` // RequestBody is the raw request body that was sent to the webhook. This is // expected to be an Event object. It may either be encoded in the API // response as a string (with JSON delimiters escaped) or as base64. The // UnmarshalJSON method will attempt to convert it to an *Event type, but it // may be set to a default type if decoding to an object fails. RequestBody interface{} `json:"request_body,omitempty" url:"request_body,omitempty"` ResponseHeaders map[string]string `json:"response_headers,omitempty" url:"response_headers,omitempty"` ResponseBody string `json:"response_body,omitempty" url:"response_body,omitempty"` ResponseCode int `json:"response_code,omitempty" url:"response_code,omitempty"` TotalTime int `json:"total_time,omitempty" url:"total_time,omitempty"` }
EventPayload represents the result of a webhook call.
func (*EventPayload) UnmarshalJSON ¶
func (e *EventPayload) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON will attempt to convert an event payload response to an *EventPayload type, but it may be set to a default type if decoding to an object fails.
type ExternalApiError ¶
type ExternalApiError struct {
LibraryError // subtype of LibraryError
}
ExternalApiError represents an error caused by an external API, such as a 3rd party HTTP API (not EasyPost).
func (*ExternalApiError) Unwrap ¶
func (e *ExternalApiError) Unwrap() error
Unwrap returns the underlying LibraryError object.
type Fee ¶
type Fee struct { Object string `json:"object,omitempty" url:"object,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Amount string `json:"amount,omitempty" url:"amount,omitempty"` Charged bool `json:"charged,omitempty" url:"charged,omitempty"` Refunded bool `json:"refunded,omitempty" url:"refunded,omitempty"` }
Fee objects are used to represent the breakdown of charges made when purchasing an item on EasyPost.
type FieldError ¶
type FieldError struct { // Field may be provided when the error relates to a specific field. Field string `json:"field,omitempty" url:"field,omitempty"` // Message is a human-readable description of the problem encountered. Message interface{} `json:"message,omitempty" url:"message,omitempty"` // Suggestion is an occasional insight on how to correct the error Suggestion string `json:"suggestion,omitempty" url:"suggestion,omitempty"` }
FieldError represents a FieldError object returned by the EasyPost API.
These are typically informational about why a request failed (server-side validation issues, missing data, etc.).
type FilteringError ¶
type FilteringError struct {
LocalError // subtype of LocalError
}
FilteringError is raised when there is an issue while running a filtering operation.
func (*FilteringError) Unwrap ¶
func (e *FilteringError) Unwrap() error
Unwrap returns the underlying LocalError error.
type ForbiddenError ¶
type ForbiddenError struct {
APIError // subtype of APIError
}
ForbiddenError is raised when the API returns a 403 status code.
func (*ForbiddenError) Unwrap ¶
func (e *ForbiddenError) Unwrap() error
Unwrap returns the underlying APIError error.
type Form ¶
type Form struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` FormType string `json:"form_type,omitempty" url:"form_type,omitempty"` FormURL string `json:"form_url,omitempty" url:"form_url,omitempty"` SubmittedElectronically bool `json:"submitted_electronically,omitempty" url:"submitted_electronically,omitempty"` }
A Form represents a form associated with a Shipment.
type GatewayTimeoutError ¶
type GatewayTimeoutError struct {
APIError // subtype of APIError
}
GatewayTimeoutError is raised when the API returns a 504 status code.
func (*GatewayTimeoutError) Unwrap ¶
func (e *GatewayTimeoutError) Unwrap() error
Unwrap returns the underlying APIError error.
type HookEventSubscriber ¶
type HookEventSubscriber struct {
ID string // need unique ID for removal
}
HookEventSubscriber is the base type for all hook event subscribers. ID needs to be unique in order to find and remove the subscriber
type Hooks ¶
type Hooks struct { RequestHookEventSubscriptions []RequestHookEventSubscriber // these are directly accessible by the user, but should not be modified directly (use Add/Remove methods) ResponseHookEventSubscriptions []ResponseHookEventSubscriber }
Hooks is a collection of HookEventSubscriber instances for various hooks available in the client
func (*Hooks) AddRequestEventSubscriber ¶
func (h *Hooks) AddRequestEventSubscriber(subscriber RequestHookEventSubscriber)
AddRequestEventSubscriber adds a RequestHookEventSubscriber to the Hooks instance to be executed when a RequestHookEvent is fired
func (*Hooks) AddResponseEventSubscriber ¶
func (h *Hooks) AddResponseEventSubscriber(subscriber ResponseHookEventSubscriber)
AddResponseEventSubscriber adds a ResponseHookEventSubscriber to the Hooks instance to be executed when a ResponseHookEvent is fired
func (*Hooks) RemoveRequestEventSubscriber ¶
func (h *Hooks) RemoveRequestEventSubscriber(subscriber RequestHookEventSubscriber)
RemoveRequestEventSubscriber removes a RequestHookEventSubscriber from the Hooks instance
func (*Hooks) RemoveResponseEventSubscriber ¶
func (h *Hooks) RemoveResponseEventSubscriber(subscriber ResponseHookEventSubscriber)
RemoveResponseEventSubscriber removes a ResponseHookEventSubscriber from the Hooks instance
type Insurance ¶
type Insurance struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Amount string `json:"amount,omitempty" url:"amount,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Provider string `json:"provider,omitempty" url:"provider,omitempty"` ProviderID string `json:"provider_id,omitempty" url:"provider_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` Tracker *Tracker `json:"tracker,omitempty" url:"tracker,omitempty"` ToAddress *Address `json:"to_address,omitempty" url:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty" url:"from_address,omitempty"` Fee *Fee `json:"fee,omitempty" url:"fee,omitempty"` Messages []string `json:"messages,omitempty" url:"messages,omitempty"` }
An Insurance object represents insurance for packages purchased both via the EasyPost API and shipments purchased through third parties and later registered with EasyPost.
type InternalServerError ¶
type InternalServerError struct {
APIError // subtype of APIError
}
InternalServerError is raised when the API returns a 500 status code.
func (*InternalServerError) Unwrap ¶
func (e *InternalServerError) Unwrap() error
Unwrap returns the underlying APIError error.
type InvalidFunctionError ¶
type InvalidFunctionError struct {
LocalError // subtype of LocalError
}
InvalidFunctionError is raised when a function call is invalid or not allowed.
func (*InvalidFunctionError) Unwrap ¶
func (e *InvalidFunctionError) Unwrap() error
Unwrap returns the underlying LocalError error.
type InvalidObjectError ¶
type InvalidObjectError struct {
LocalError // subtype of LocalError
}
InvalidObjectError is raised when an object is invalid.
func (*InvalidObjectError) Unwrap ¶
func (e *InvalidObjectError) Unwrap() error
Unwrap returns the underlying LocalError error.
type InvalidRequestError ¶
type InvalidRequestError struct {
APIError // subtype of APIError
}
InvalidRequestError is raised when the API returns a 422 status code.
func (*InvalidRequestError) Unwrap ¶
func (e *InvalidRequestError) Unwrap() error
Unwrap returns the underlying APIError error.
type LibraryError ¶
type LibraryError struct {
// Message is a human-readable error description.
Message interface{}
}
LibraryError is the base type for all errors/exceptions in this EasyPost library.
func (*LibraryError) Error ¶
func (e *LibraryError) Error() string
Error provides a pretty printed string of a LibraryError object.
func (*LibraryError) UnmarshalJSON ¶
func (e *LibraryError) UnmarshalJSON(data []byte) error
type ListAddressResult ¶
type ListAddressResult struct { Addresses []*Address `json:"addresses,omitempty" url:"addresses,omitempty"` PaginatedCollection }
ListAddressResult holds the results from the list addresses API.
type ListBatchesResult ¶
type ListBatchesResult struct { Batch []*Batch `json:"batches,omitempty" url:"batches,omitempty"` PaginatedCollection }
ListBatchesResult holds the results from the list insurances API.
type ListChildUsersResult ¶
type ListChildUsersResult struct { Children []*User `json:"children,omitempty" url:"children,omitempty"` PaginatedCollection }
type ListClaimsParameters ¶
type ListClaimsParameters struct { BeforeID string `json:"before_id,omitempty" url:"before_id,omitempty"` AfterID string `json:"after_id,omitempty" url:"after_id,omitempty"` StartDateTime *DateTime `json:"start_datetime,omitempty" url:"start_datetime,omitempty"` EndDateTime *DateTime `json:"end_datetime,omitempty" url:"end_datetime,omitempty"` PageSize int `json:"page_size,omitempty" url:"page_size,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` }
ListClaimsParameters is used to specify query parameters for listing claims.
type ListClaimsResult ¶
type ListClaimsResult struct { Claims []*Claim `json:"claims,omitempty" url:"claims,omitempty"` Parameters ListClaimsParameters PaginatedCollection }
ListClaimsResult holds the results from the list claims API.
type ListEndShipperResult ¶
type ListEndShipperResult struct { EndShippers []*Address `json:"endshippers,omitempty" url:"endshippers,omitempty"` HasMore bool `json:"has_more,omitempty" url:"has_more,omitempty"` }
ListEndShipperResult holds the results from the list EndShippers API.
type ListEventsResult ¶
type ListEventsResult struct { Events []*Event `json:"events,omitempty" url:"events,omitempty"` PaginatedCollection }
ListEventsResult holds the results from the list events API.
type ListInsurancesResult ¶
type ListInsurancesResult struct { Insurances []*Insurance `json:"insurances,omitempty" url:"insurances,omitempty"` PaginatedCollection }
ListInsurancesResult holds the results from the list insurances API.
type ListOptions ¶
type ListOptions struct { BeforeID string `url:"before_id,omitempty"` AfterID string `url:"after_id,omitempty"` StartDateTime *DateTime `url:"start_datetime,omitempty"` EndDateTime *DateTime `url:"end_datetime,omitempty"` PageSize int `url:"page_size,omitempty"` }
ListOptions is used to specify query parameters for listing EasyPost objects.
type ListPickupResult ¶
type ListPickupResult struct { Pickups []*Pickup `json:"pickups,omitempty" url:"pickups,omitempty"` PaginatedCollection }
ListPickupResult holds the results from the list Pickup API.
type ListReferralCustomersResult ¶
type ListReferralCustomersResult struct { ReferralCustomers []*ReferralCustomer `json:"referral_customers,omitempty" url:"referral_customers,omitempty"` PaginatedCollection }
ListReferralCustomersResult holds the results from the list referral customers API call.
type ListRefundResult ¶
type ListRefundResult struct { Refunds []*Refund `json:"refunds,omitempty" url:"refunds,omitempty"` PaginatedCollection }
type ListReportsResult ¶
type ListReportsResult struct { Reports []*Report `json:"reports,omitempty" url:"reports,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` PaginatedCollection }
ListReportsResult holds the results from the list reports API.
type ListScanFormsResult ¶
type ListScanFormsResult struct { ScanForms []*ScanForm `json:"scan_forms,omitempty" url:"scan_forms,omitempty"` PaginatedCollection }
ListScanFormsResult holds the results from the list scan forms API.
type ListShipmentsOptions ¶
type ListShipmentsOptions struct { BeforeID string `json:"before_id,omitempty" url:"before_id,omitempty"` AfterID string `json:"after_id,omitempty" url:"after_id,omitempty"` StartDateTime *DateTime `json:"start_datetime,omitempty" url:"start_datetime,omitempty"` EndDateTime *DateTime `json:"end_datetime,omitempty" url:"end_datetime,omitempty"` PageSize int `json:"page_size,omitempty" url:"page_size,omitempty"` Purchased *bool `json:"purchased,omitempty" url:"purchased,omitempty"` IncludeChildren *bool `json:"include_children,omitempty" url:"include_children,omitempty"` }
ListShipmentsOptions is used to specify query parameters for listing Shipment objects.
type ListShipmentsResult ¶
type ListShipmentsResult struct { Shipments []*Shipment `json:"shipments,omitempty" url:"shipments,omitempty"` Purchased *bool `json:"purchased,omitempty" url:"purchased,omitempty"` IncludeChildren *bool `json:"include_children,omitempty" url:"include_children,omitempty"` PaginatedCollection }
ListShipmentsResult holds the results from the list shipments API.
type ListTrackersOptions ¶
type ListTrackersOptions struct { BeforeID string `json:"before_id,omitempty" url:"before_id,omitempty"` AfterID string `json:"after_id,omitempty" url:"after_id,omitempty"` StartDateTime *DateTime `json:"start_datetime,omitempty" url:"start_datetime,omitempty"` EndDateTime *DateTime `json:"end_datetime,omitempty" url:"end_datetime,omitempty"` PageSize int `json:"page_size,omitempty" url:"page_size,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` TrackingCodes []string `json:"tracking_codes,omitempty" url:"tracking_codes,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` }
ListTrackersOptions is used to specify query parameters for listing Tracker objects.
type ListTrackersResult ¶
type ListTrackersResult struct { Trackers []*Tracker `json:"trackers,omitempty" url:"trackers,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` PaginatedCollection }
ListTrackersResult holds the results from the list trackers API.
type ListTrackersUpdatedOptions ¶
type ListTrackersUpdatedOptions struct { Page int `json:"page,omitempty" url:"page,omitempty"` PageSize int `json:"page_size,omitempty" url:"page_size,omitempty"` StatusStart *DateTime `json:"status_start,omitempty" url:"status_start,omitempty"` StatusEnd *DateTime `json:"status_end,omitempty" url:"status_end,omitempty"` TrackingDetailsStart *DateTime `json:"tracking_details_start,omitempty" url:"tracking_details_start,omitempty"` TrackingDetailsEnd *DateTime `json:"tracking_details_end,omitempty" url:"tracking_details_end,omitempty"` }
ListTrackersUpdatedOptions specifies options for the list trackers updated API.
type LocalError ¶
type LocalError struct {
LibraryError // subtype of LibraryError
}
LocalError represents an error caused by the EasyPost library itself, such as validation or JSON serialization issues.
func (*LocalError) Unwrap ¶
func (e *LocalError) Unwrap() error
Unwrap returns the underlying LibraryError error.
type LumaInfo ¶ added in v5.2.0
type LumaInfo struct { AiResults []*AiResults `json:"ai_results,omitempty" url:"ai_results,omitempty"` MatchingRuleIdx int `json:"matching_rule_idx,omitempty" url:"matching_rule_idx,omitempty"` RulesetDescription string `json:"ruleset_description,omitempty" url:"ruleset_description,omitempty"` LumaSelectedRate *Rate `json:"luma_selected_rate,omitempty" url:"luma_selected_rate,omitempty"` }
LumaInfo contains information about the Luma AI results for a shipment.
type LumaPromiseResponse ¶ added in v5.2.0
type LumaPromiseResponse struct {
LumaInfo *LumaInfo `json:"luma_info,omitempty" url:"luma_info,omitempty"`
}
LumaPromiseResponse represents the response from the Luma AI Promise API.
type LumaRequest ¶ added in v5.2.0
type LumaRequest struct { Shipment RulesetName string `json:"ruleset_name,omitempty" url:"ruleset_name,omitempty"` PlannedShipDate string `json:"planned_ship_date,omitempty" url:"planned_ship_date,omitempty"` DeliverByDate string `json:"deliver_by_date,omitempty" url:"deliver_by_date,omitempty"` PersistLabel bool `json:"persist_label,omitempty" url:"persist_label,omitempty"` }
LumaRequest represents the request parameters for the Luma AI Promise API.
type MandateData ¶
type MandateData struct { IpAddress string `json:"ip_address,omitempty" url:"ip_address,omitempty"` UserAgent string `json:"user_agent,omitempty" url:"user_agent,omitempty"` AcceptedAt int64 `json:"accepted_at,omitempty" url:"accepted_at,omitempty"` }
MandateData specifies the mandate data needed for adding a bank account from stripe.
type MetadataPredefinedPackage ¶
type MetadataPredefinedPackage struct { Name string `json:"name,omitempty" url:"name,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty" url:"human_readable,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Dimensions []string `json:"dimensions,omitempty" url:"dimensions,omitempty"` MaxWeight float64 `json:"max_weight,omitempty" url:"max_weight,omitempty"` }
MetadataPredefinedPackage represents an available predefined package of a carrier.
type MetadataServiceLevel ¶
type MetadataServiceLevel struct { Name string `json:"name,omitempty" url:"name,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty" url:"human_readable,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Dimensions []string `json:"dimensions,omitempty" url:"dimensions,omitempty"` MaxWeight float64 `json:"max_weight,omitempty" url:"max_weight,omitempty"` }
MetadataServiceLevel represents an available service level of a carrier.
type MetadataShipmentOption ¶
type MetadataShipmentOption struct { Name string `json:"name,omitempty" url:"name,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty" url:"human_readable,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Deprecated bool `json:"deprecated,omitempty" url:"deprecated,omitempty"` Type string `json:"type,omitempty" url:"type,omitempty"` }
MetadataShipmentOption represents an available shipment option of a carrier.
type MetadataSupportedFeature ¶
type MetadataSupportedFeature struct { Name string `json:"name,omitempty" url:"name,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Supported bool `json:"supported,omitempty" url:"supported,omitempty"` }
MetadataSupportedFeature represents a supported feature of a carrier.
type MethodNotAllowedError ¶
type MethodNotAllowedError struct {
APIError // subtype of APIError
}
MethodNotAllowedError is raised when the API returns a 405 status code.
func (*MethodNotAllowedError) Unwrap ¶
func (e *MethodNotAllowedError) Unwrap() error
Unwrap returns the underlying APIError error.
type MinifiedRate ¶
type MismatchWebhookSignatureError ¶
type MismatchWebhookSignatureError struct {
LocalError // subtype of LocalError
}
MismatchWebhookSignatureError is raised when a webhook received did not originate from EasyPost or had a webhook secret mismatch.
func (*MismatchWebhookSignatureError) Unwrap ¶
func (e *MismatchWebhookSignatureError) Unwrap() error
Unwrap returns the underlying LocalError error.
type MissingPropertyError ¶
type MissingPropertyError struct {
LocalError // subtype of LocalError
}
MissingPropertyError is raised when a required property is missing.
func (*MissingPropertyError) Unwrap ¶
func (e *MissingPropertyError) Unwrap() error
Unwrap returns the underlying LocalError error.
type MissingWebhookSignatureError ¶
type MissingWebhookSignatureError struct {
LocalError // subtype of LocalError
}
MissingWebhookSignatureError is raised when a webhook does not contain a valid HMAC signature.
func (*MissingWebhookSignatureError) Unwrap ¶
func (e *MissingWebhookSignatureError) Unwrap() error
Unwrap returns the underlying LocalError error.
type MockRequest ¶
type MockRequest struct { MatchRule MockRequestMatchRule ResponseInfo MockRequestResponseInfo }
type MockRequestMatchRule ¶
type MockRequestResponseInfo ¶
func (*MockRequestResponseInfo) AsResponse ¶
func (r *MockRequestResponseInfo) AsResponse() *http.Response
func (*MockRequestResponseInfo) MockBody ¶
func (r *MockRequestResponseInfo) MockBody() io.ReadCloser
type NotFoundError ¶
type NotFoundError struct {
APIError // subtype of APIError
}
NotFoundError is raised when the API returns a 404 status code.
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
Unwrap returns the underlying APIError error.
type Order ¶
type Order struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` ToAddress *Address `json:"to_address,omitempty" url:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty" url:"from_address,omitempty"` ReturnAddress *Address `json:"return_address,omitempty" url:"return_address,omitempty"` BuyerAddress *Address `json:"buyer_address,omitempty" url:"buyer_address,omitempty"` Shipments []*Shipment `json:"shipments,omitempty" url:"shipments,omitempty"` Rates []*Rate `json:"rates,omitempty" url:"rates,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty" url:"messages,omitempty"` IsReturn bool `json:"is_return,omitempty" url:"is_return,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` CustomsInfo *CustomsInfo `json:"customs_info,omitempty" url:"customs_info,omitempty"` }
An Order object represents a collection of packages and can be used for multi-piece Shipments.
type PaginatedCollection ¶
type PaginatedCollection struct { // HasMore indicates if there are more responses to be fetched. If True, // additional responses can be fetched by updating the AfterID parameter // with the ID of the last item in this object's collection list. HasMore bool `json:"has_more,omitempty" url:"has_more,omitempty"` }
PaginatedCollection holds the results of a paginated API response.
type Parcel ¶
type Parcel struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Length float64 `json:"length,omitempty" url:"length,omitempty"` Width float64 `json:"width,omitempty" url:"width,omitempty"` Height float64 `json:"height,omitempty" url:"height,omitempty"` PredefinedPackage string `json:"predefined_package,omitempty" url:"predefined_package,omitempty"` Weight float64 `json:"weight,omitempty" url:"weight,omitempty"` }
A Parcel objects represent a physical container being shipped.
type Payment ¶
type Payment struct { Type string `json:"type,omitempty" url:"type,omitempty"` Account string `json:"account,omitempty" url:"account,omitempty"` Country string `json:"country,omitempty" url:"country,omitempty"` PostalCode string `json:"postal_code,omitempty" url:"postal_code,omitempty"` }
Payment provides information on how a shipment is billed.
type PaymentError ¶
type PaymentError struct {
APIError // subtype of APIError
}
PaymentError is raised when the API returns a 402 status code.
func (*PaymentError) Unwrap ¶
func (e *PaymentError) Unwrap() error
Unwrap returns the underlying APIError error.
type PaymentLog ¶
type PaymentLog struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` SourceType string `json:"source_type,omitempty" url:"source_type,omitempty"` TargetType string `json:"target_type,omitempty" url:"target_type,omitempty"` Date string `json:"date,omitempty" url:"date,omitempty"` ChargeType string `json:"charge_type,omitempty" url:"charge_type,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` Amount string `json:"amount,omitempty" url:"amount,omitempty"` Last4 string `json:"last4,omitempty" url:"last4,omitempty"` }
type PaymentMethod ¶
type PaymentMethod struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` PrimaryPaymentMethod *PaymentMethodObject `json:"primary_payment_method,omitempty" url:"primary_payment_method,omitempty"` SecondaryPaymentMethod *PaymentMethodObject `json:"secondary_payment_method,omitempty" url:"secondary_payment_method,omitempty"` }
type PaymentMethodObject ¶
type PaymentMethodObject struct { BankName string `json:"bank_name,omitempty" url:"bank_name,omitempty"` // bank account Brand string `json:"brand,omitempty" url:"brand,omitempty"` // credit card Country string `json:"country,omitempty" url:"country,omitempty"` // bank account DisabledAt string `json:"disabled_at,omitempty" url:"disabled_at,omitempty"` // both ExpirationMonth int `json:"exp_month,omitempty" url:"exp_month,omitempty"` // credit card ExpirationYear int `json:"exp_year,omitempty" url:"exp_year,omitempty"` // credit card ID string `json:"id,omitempty" url:"id,omitempty"` // both Last4 string `json:"last4,omitempty" url:"last4,omitempty"` // both Name string `json:"name,omitempty" url:"name,omitempty"` // credit card Object string `json:"object,omitempty" url:"object,omitempty"` // both Verified bool `json:"verified,omitempty" url:"verified,omitempty"` // bank account RequiresMandateCollection bool `json:"requires_mandate_collection,omitempty" url:"requires_mandate_collection,omitempty"` // both }
type PaymentMethodPriority ¶
type PaymentMethodPriority int64
const ( PrimaryPaymentMethodPriority PaymentMethodPriority = iota SecondaryPaymentMethodPriority )
type PaymentMethodType ¶
type PaymentMethodType int64
const ( CreditCardPaymentType PaymentMethodType = iota BankAccountPaymentType )
type Pickup ¶
type Pickup struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` MinDatetime *DateTime `json:"min_datetime,omitempty" url:"min_datetime,omitempty"` MaxDatetime *DateTime `json:"max_datetime,omitempty" url:"max_datetime,omitempty"` IsAccountAddress bool `json:"is_account_address,omitempty" url:"is_account_address,omitempty"` Instructions string `json:"instructions,omitempty" url:"instructions,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty" url:"messages,omitempty"` Confirmation string `json:"confirmation,omitempty" url:"confirmation,omitempty"` Shipment *Shipment `json:"shipment,omitempty" url:"shipment,omitempty"` Address *Address `json:"address,omitempty" url:"address,omitempty"` Batch *Batch `json:"batch,omitempty" url:"batch,omitempty"` CarrierAccounts []*CarrierAccount `json:"carrier_accounts,omitempty" url:"carrier_accounts,omitempty"` PickupRates []*PickupRate `json:"pickup_rates,omitempty" url:"pickup_rates,omitempty"` }
A Pickup object represents a pickup from a carrier at a customer's residence or place of business.
type PickupRate ¶
type PickupRate struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Rate string `json:"rate,omitempty" url:"rate,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` PickupID string `json:"pickup_id,omitempty" url:"pickup_id,omitempty"` }
PickupRate contains data about the cost of a pickup.
type PostageLabel ¶
type PostageLabel struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` IntegratedForm string `json:"integrated_form,omitempty" url:"integrated_form,omitempty"` LabelDate *DateTime `json:"label_date,omitempty" url:"label_date,omitempty"` LabelEPL2URL string `json:"label_epl2_url,omitempty" url:"label_epl2_url,omitempty"` LabelFileType string `json:"label_file_type,omitempty" url:"label_file_type,omitempty"` LabelPDFURL string `json:"label_pdf_url,omitempty" url:"label_pdf_url,omitempty"` LabelResolution float64 `json:"label_resolution,omitempty" url:"label_resolution,omitempty"` LabelSize string `json:"label_size,omitempty" url:"label_size,omitempty"` LabelType string `json:"label_type,omitempty" url:"label_type,omitempty"` LabelURL string `json:"label_url,omitempty" url:"label_url,omitempty"` LabelZPLURL string `json:"label_zpl_url,omitempty" url:"label_zpl_url,omitempty"` }
PostageLabel provides details of a shipping label for a purchased shipment.
type ProxyError ¶
type ProxyError struct {
APIError // subtype of APIError
}
ProxyError is raised when the API returns a 407 status code.
func (*ProxyError) Unwrap ¶
func (e *ProxyError) Unwrap() error
Unwrap returns the underlying APIError error.
type Rate ¶
type Rate struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty" url:"carrier_account_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` Rate string `json:"rate,omitempty" url:"rate,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` RetailRate string `json:"retail_rate,omitempty" url:"retail_rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty" url:"retail_currency,omitempty"` ListRate string `json:"list_rate,omitempty" url:"list_rate,omitempty"` ListCurrency string `json:"list_currency,omitempty" url:"list_currency,omitempty"` DeliveryDays int `json:"delivery_days,omitempty" url:"delivery_days,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty" url:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty" url:"delivery_date_guaranteed,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty" url:"est_delivery_days,omitempty"` BillingType string `json:"billing_type,omitempty" url:"billing_type,omitempty"` }
A Rate contains information on shipping cost and delivery time.
type RateLimitError ¶
type RateLimitError struct {
APIError // subtype of APIError
}
RateLimitError is raised when the API returns a 429 status code.
func (*RateLimitError) Unwrap ¶
func (e *RateLimitError) Unwrap() error
Unwrap returns the underlying APIError error.
type RecommendShipDateForShipmentResult ¶
type RecommendShipDateForShipmentResult struct { Rate *SmartRate `json:"rate,omitempty" url:"rate,omitempty"` EasyPostTimeInTransitData *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty" url:"easypost_time_in_transit_data,omitempty"` }
RecommendShipDateForShipmentResult is the result of the RecommendShipDateForShipment method.
type RecommendShipDateForZipPairParams ¶
type RecommendShipDateForZipPairParams struct { FromZip string `json:"from_zip,omitempty" url:"from_zip,omitempty"` ToZip string `json:"to_zip,omitempty" url:"to_zip,omitempty"` Carriers []string `json:"carriers,omitempty" url:"carriers,omitempty"` DesiredDeliveryDate string `json:"desired_delivery_date,omitempty" url:"desired_delivery_date,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty" url:"saturday_delivery,omitempty"` }
RecommendShipDateForZipPairParams are used in the RecommendShipDateForZipPair method.
type RecommendShipDateForZipPairResult ¶
type RecommendShipDateForZipPairResult struct { CarriersWithoutEstimates []string `json:"carriers_without_tint_estimates,omitempty" url:"carriers_without_tint_estimates,omitempty"` FromZip string `json:"from_zip,omitempty" url:"from_zip,omitempty"` ToZip string `json:"to_zip,omitempty" url:"to_zip,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty" url:"saturday_delivery,omitempty"` DesiredDeliveryDate *DateTime `json:"desired_delivery_date,omitempty" url:"desired_delivery_date,omitempty"` Results []*ShipDateForZipPairRecommendation `json:"results,omitempty" url:"results,omitempty"` }
RecommendShipDateForZipPairResult is the result of the RecommendShipDateForZipPair method, containing the recommended ship date of each carrier-service level combination and additional metadata.
type RedirectError ¶
type RedirectError struct {
APIError // subtype of APIError
}
RedirectError is raised when the API returns a 3xx status code.
func (*RedirectError) Unwrap ¶
func (e *RedirectError) Unwrap() error
Unwrap returns the underlying APIError error.
type ReferralCustomer ¶
type ReferralCustomer struct {
User
}
A ReferralCustomer contains data about an EasyPost referral customer.
type Refund ¶
type Refund struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` ConfirmationNumber string `json:"confirmation_number,omitempty" url:"confirmation_number,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` }
type Report ¶
type Report struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` StartDate string `json:"start_date,omitempty" url:"start_date,omitempty"` EndDate string `json:"end_date,omitempty" url:"end_date,omitempty"` IncludeChildren bool `json:"include_children,omitempty" url:"include_children,omitempty"` URL string `json:"url,omitempty" url:"url,omitempty"` URLExpiresAt *DateTime `json:"url_expires_at,omitempty" url:"url_expires_at,omitempty"` SendEmail bool `json:"send_email,omitempty" url:"send_email,omitempty"` Columns []string `json:"columns,omitempty" url:"columns,omitempty"` AdditionalColumns []string `json:"additional_columns,omitempty" url:"additional_columns,omitempty"` }
Report represents a CSV-formatted file that is a log of all the objects created within a certain time frame.
type RequestHookEvent ¶
type RequestHookEvent struct { HookEvent // implements HookEvent Method string Url *url.URL RequestBody io.ReadCloser Headers map[string][]string RequestTimestamp time.Time Id uuid.UUID }
RequestHookEvent is the data passed to a RequestHookEventSubscriberCallback function
type RequestHookEventSubscriber ¶
type RequestHookEventSubscriber struct { HookEventSubscriber // implements HookEventSubscriber Callback RequestHookEventSubscriberCallback }
RequestHookEventSubscriber is a HookEventSubscriber that executes a RequestHookEventSubscriberCallback function when a RequestHookEvent is fired
func (RequestHookEventSubscriber) Execute ¶
func (s RequestHookEventSubscriber) Execute(ctx context.Context, event RequestHookEvent)
Execute executes the RequestHookEventSubscriberCallback function of the RequestHookEventSubscriber
type RequestHookEventSubscriberCallback ¶
type RequestHookEventSubscriberCallback func(ctx context.Context, event RequestHookEvent) error
RequestHookEventSubscriberCallback is the type of the callback function executed by an RequestHookEventSubscriber
type ResponseHookEvent ¶
type ResponseHookEvent struct { HookEvent // implements HookEvent HttpStatus int Method string Url *url.URL Headers map[string][]string ResponseBody io.ReadCloser RequestTimestamp time.Time ResponseTimestamp time.Time Id uuid.UUID }
ResponseHookEvent is the data passed to a ResponseHookEventSubscriberCallback function
type ResponseHookEventSubscriber ¶
type ResponseHookEventSubscriber struct { HookEventSubscriber // implements HookEventSubscriber Callback ResponseHookEventSubscriberCallback }
ResponseHookEventSubscriber is a HookEventSubscriber that executes a ResponseHookEventSubscriberCallback function when a ResponseHookEvent is fired
func (ResponseHookEventSubscriber) Execute ¶
func (s ResponseHookEventSubscriber) Execute(ctx context.Context, event ResponseHookEvent)
Execute executes the ResponseHookEventSubscriberCallback function of the ResponseHookEventSubscriber
type ResponseHookEventSubscriberCallback ¶
type ResponseHookEventSubscriberCallback func(ctx context.Context, event ResponseHookEvent) error
ResponseHookEventSubscriberCallback is the type of the callback function executed by an ResponseHookEventSubscriber
type RetryError ¶
type RetryError struct {
APIError // subtype of APIError
}
RetryError is raised when the API returns a 1xx status code.
func (*RetryError) Unwrap ¶
func (e *RetryError) Unwrap() error
Unwrap returns the underlying APIError error.
type SSLError ¶
type SSLError struct {
APIError // subtype of APIError
}
SSLError is raised when there is an issue with the SSL certificate.
type ScanForm ¶
type ScanForm struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` Message string `json:"message,omitempty" url:"message,omitempty"` Address *Address `json:"address,omitempty" url:"address,omitempty"` TrackingCodes []string `json:"tracking_codes,omitempty" url:"tracking_codes,omitempty"` FormURL string `json:"form_url,omitempty" url:"form_url,omitempty"` FormFileType string `json:"form_file_type,omitempty" url:"form_file_type,omitempty"` BatchID string `json:"batch_id,omitempty" url:"batch_id,omitempty"` }
A ScanForm object represents a document that can be scanned to mark all included tracking codes as "Accepted for Shipment" by the carrier.
type ServiceUnavailableError ¶
type ServiceUnavailableError struct {
}ServiceUnavailableError is raised when the API returns a 503 status code.
func (*ServiceUnavailableError) Unwrap ¶
func (e *ServiceUnavailableError) Unwrap() error
Unwrap returns the underlying APIError error.
type ShipDateForZipPairRecommendation ¶
type ShipDateForZipPairRecommendation struct { Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` EasyPostTimeInTransitData *TimeInTransitDetailsForShipDate `json:"easypost_time_in_transit_data,omitempty" url:"easypost_time_in_transit_data,omitempty"` }
ShipDateForZipPairRecommendation is a single zip-pair-based ship date recommendation for a carrier-service level combination.
type Shipment ¶
type Shipment struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` ToAddress *Address `json:"to_address,omitempty" url:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty" url:"from_address,omitempty"` ReturnAddress *Address `json:"return_address,omitempty" url:"return_address,omitempty"` BuyerAddress *Address `json:"buyer_address,omitempty" url:"buyer_address,omitempty"` Parcel *Parcel `json:"parcel,omitempty" url:"parcel,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` CarrierAccountIDs []string `json:"carrier_accounts,omitempty" url:"carrier_accounts,omitempty"` CustomsInfo *CustomsInfo `json:"customs_info,omitempty" url:"customs_info,omitempty"` ScanForm *ScanForm `json:"scan_form,omitempty" url:"scan_form,omitempty"` Forms []*Form `json:"forms,omitempty" url:"forms,omitempty"` Insurance string `json:"insurance,omitempty" url:"insurance,omitempty"` Rates []*Rate `json:"rates,omitempty" url:"rates,omitempty"` SelectedRate *Rate `json:"selected_rate,omitempty" url:"selected_rate,omitempty"` PostageLabel *PostageLabel `json:"postage_label,omitempty" url:"postage_label,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty" url:"messages,omitempty"` Options *ShipmentOptions `json:"options,omitempty" url:"options,omitempty"` IsReturn bool `json:"is_return,omitempty" url:"is_return,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` USPSZone int `json:"usps_zone,omitempty" url:"usps_zone,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` Tracker *Tracker `json:"tracker,omitempty" url:"tracker,omitempty"` Fees []*Fee `json:"fees,omitempty" url:"fees,omitempty"` RefundStatus string `json:"refund_status,omitempty" url:"refund_status,omitempty"` BatchID string `json:"batch_id,omitempty" url:"batch_id,omitempty"` BatchStatus string `json:"batch_status,omitempty" url:"batch_status,omitempty"` BatchMessage string `json:"batch_message,omitempty" url:"batch_message,omitempty"` TaxIdentifiers []*TaxIdentifier `json:"tax_identifiers,omitempty" url:"tax_identifiers,omitempty"` }
A Shipment represents its namesake, and is made up of a "to" and "from" addresses, the Parcel being shipped, and any customs forms required for international deliveries.
type ShipmentOptions ¶
type ShipmentOptions struct { AdditionalHandling bool `json:"additional_handling,omitempty" url:"additional_handling,omitempty"` AddressValidationLevel string `json:"address_validation_level,omitempty" url:"address_validation_level,omitempty"` Alcohol bool `json:"alcohol,omitempty" url:"alcohol,omitempty"` BillingRef string `json:"billing_ref,omitempty" url:"billing_ref,omitempty"` BillReceiverAccount string `json:"bill_receiver_account,omitempty" url:"bill_receiver_account,omitempty"` BillReceiverPostalCode string `json:"bill_receiver_postal_code,omitempty" url:"bill_receiver_postal_code,omitempty"` BillThirdPartyAccount string `json:"bill_third_party_account,omitempty" url:"bill_third_party_account,omitempty"` BillThirdPartyCountry string `json:"bill_third_party_country,omitempty" url:"bill_third_party_country,omitempty"` BillThirdPartyPostalCode string `json:"bill_third_party_postal_code,omitempty" url:"bill_third_party_postal_code,omitempty"` ByDrone bool `json:"by_drone,omitempty" url:"by_drone,omitempty"` CarbonNeutral bool `json:"carbon_neutral,omitempty" url:"carbon_neutral,omitempty"` CertifiedMail bool `json:"certified_mail,omitempty" url:"certified_mail,omitempty"` CODAmount string `json:"cod_amount,omitempty" url:"cod_amount,omitempty"` CODMethod string `json:"cod_method,omitempty" url:"cod_method,omitempty"` CODAddressID string `json:"cod_address_id,omitempty" url:"cod_address_id,omitempty"` CommercialInvoiceSignature string `json:"commercial_invoice_signature,omitempty" url:"commercial_invoice_signature,omitempty"` CommercialInvoiceLetterhead string `json:"commercial_invoice_letterhead,omitempty" url:"commercial_invoice_letterhead,omitempty"` ContentDescription string `json:"content_description,omitempty" url:"content_description,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` DeliveryConfirmation string `json:"delivery_confirmation,omitempty" url:"delivery_confirmation,omitempty"` DeliveryMaxDatetime *DateTime `json:"delivery_max_datetime,omitempty" url:"delivery_max_datetime,omitempty"` DutyPayment *Payment `json:"duty_payment,omitempty" url:"duty_payment,omitempty"` DutyPaymentAccount string `json:"duty_payment_account,omitempty" url:"duty_payment_account,omitempty"` DropoffMaxDatetime *DateTime `json:"dropoff_max_datetime,omitempty" url:"dropoff_max_datetime,omitempty"` DropoffType string `json:"dropoff_type,omitempty" url:"dropoff_type,omitempty"` DryIce bool `json:"dry_ice,omitempty" url:"dry_ice,omitempty"` DryIceMedical bool `json:"dry_ice_medical,omitempty,string" url:"dry_ice_medical,omitempty"` DryIceWeight float64 `json:"dry_ice_weight,omitempty,string" url:"dry_ice_weight,omitempty"` Endorsement string `json:"endorsement,omitempty" url:"endorsement,omitempty"` EndShipperID string `json:"end_shipper_id,omitempty" url:"end_shipper_id,omitempty"` FreightCharge float64 `json:"freight_charge,omitempty" url:"freight_charge,omitempty"` HandlingInstructions string `json:"handling_instructions,omitempty" url:"handling_instructions,omitempty"` Hazmat string `json:"hazmat,omitempty" url:"hazmat,omitempty"` HoldForPickup bool `json:"hold_for_pickup,omitempty" url:"hold_for_pickup,omitempty"` Incoterm string `json:"incoterm,omitempty" url:"incoterm,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty" url:"invoice_number,omitempty"` LabelDate *DateTime `json:"label_date,omitempty" url:"label_date,omitempty"` LabelFormat string `json:"label_format,omitempty" url:"label_format,omitempty"` LabelSize string `json:"label_size,omitempty" url:"label_size,omitempty"` Machinable bool `json:"machinable,omitempty" url:"machinable,omitempty"` Payment *Payment `json:"payment,omitempty" url:"payment,omitempty"` PickupMinDatetime *DateTime `json:"pickup_min_datetime,omitempty" url:"pickup_min_datetime,omitempty"` PickupMaxDatetime *DateTime `json:"pickup_max_datetime,omitempty" url:"pickup_max_datetime,omitempty"` PrintCustom1 string `json:"print_custom_1,omitempty" url:"print_custom_1,omitempty"` PrintCustom2 string `json:"print_custom_2,omitempty" url:"print_custom_2,omitempty"` PrintCustom3 string `json:"print_custom_3,omitempty" url:"print_custom_3,omitempty"` PrintCustom1BarCode bool `json:"print_custom_1_barcode,omitempty" url:"print_custom_1_barcode,omitempty"` PrintCustom2BarCode bool `json:"print_custom_2_barcode,omitempty" url:"print_custom_2_barcode,omitempty"` PrintCustom3BarCode bool `json:"print_custom_3_barcode,omitempty" url:"print_custom_3_barcode,omitempty"` PrintCustom1Code string `json:"print_custom_1_code,omitempty" url:"print_custom_1_code,omitempty"` PrintCustom2Code string `json:"print_custom_2_code,omitempty" url:"print_custom_2_code,omitempty"` PrintCustom3Code string `json:"print_custom_3_code,omitempty" url:"print_custom_3_code,omitempty"` RegisteredMail bool `json:"registered_mail,omitempty" url:"registered_mail,omitempty"` RegisteredMailAmount float64 `json:"registered_mail_amount,omitempty" url:"registered_mail_amount,omitempty"` ReturnReceipt bool `json:"return_receipt,omitempty" url:"return_receipt,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty" url:"saturday_delivery,omitempty"` SpecialRatesEligibility string `json:"special_rates_eligibility,omitempty" url:"special_rates_eligibility,omitempty"` SmartpostHub string `json:"smartpost_hub,omitempty" url:"smartpost_hub,omitempty"` SmartpostManifest string `json:"smartpost_manifest,omitempty" url:"smartpost_manifest,omitempty"` SuppressETD bool `json:"suppress_etd,omitempty" url:"suppress_etd,omitempty"` }
ShipmentOptions represents the various options that can be applied to a shipment at creation.
type SmartRate ¶
type SmartRate struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty" url:"carrier_account_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` Rate float64 `json:"rate,omitempty" url:"rate,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` RetailRate float64 `json:"retail_rate,omitempty" url:"retail_rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty" url:"retail_currency,omitempty"` ListRate float64 `json:"list_rate,omitempty" url:"list_rate,omitempty"` ListCurrency string `json:"list_currency,omitempty" url:"list_currency,omitempty"` DeliveryDays int `json:"delivery_days,omitempty" url:"delivery_days,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty" url:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty" url:"delivery_date_guaranteed,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty" url:"est_delivery_days,omitempty"` TimeInTransit *TimeInTransit `json:"time_in_transit,omitempty" url:"time_in_transit,omitempty"` BillingType string `json:"billing_type,omitempty" url:"billing_type,omitempty"` }
A SmartRate contains information on shipping cost and delivery time in addition to time-in-transit details.
type StatelessRate ¶
type StatelessRate struct { BillingType string `json:"billing_type,omitempty" url:"billing_type,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty" url:"carrier_account_id,omitempty"` Currency string `json:"currency,omitempty" url:"currency,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty" url:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty" url:"delivery_date_guaranteed,omitempty"` DeliveryDays int `json:"delivery_days,omitempty" url:"delivery_days,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty" url:"est_delivery_days,omitempty"` ListCurrency string `json:"list_currency,omitempty" url:"list_currency,omitempty"` ListRate string `json:"list_rate,omitempty" url:"list_rate,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Rate string `json:"rate,omitempty" url:"rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty" url:"retail_currency,omitempty"` RetailRate string `json:"retail_rate,omitempty" url:"retail_rate,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` }
A StatelessRate contains information on shipping cost and delivery time, but does not have an ID (is ephemeral).
type TaxIdentifier ¶
type TaxIdentifier struct { Entity string `json:"entity,omitempty" url:"entity,omitempty"` TaxIdType string `json:"tax_id_type,omitempty" url:"tax_id_type,omitempty"` TaxId string `json:"tax_id,omitempty" url:"tax_id,omitempty"` IssuingCountry string `json:"issuing_country,omitempty" url:"issuing_country,omitempty"` }
TaxIdentifier objects contain tax information used by carriers.
type TimeInTransit ¶
type TimeInTransit struct { Percentile50 int `json:"percentile_50,omitempty" url:"percentile_50,omitempty"` Percentile75 int `json:"percentile_75,omitempty" url:"percentile_75,omitempty"` Percentile85 int `json:"percentile_85,omitempty" url:"percentile_85,omitempty"` Percentile90 int `json:"percentile_90,omitempty" url:"percentile_90,omitempty"` Percentile95 int `json:"percentile_95,omitempty" url:"percentile_95,omitempty"` Percentile97 int `json:"percentile_97,omitempty" url:"percentile_97,omitempty"` Percentile99 int `json:"percentile_99,omitempty" url:"percentile_99,omitempty"` }
TimeInTransit provides details on the probability your package will arrive within a certain number of days
type TimeInTransitDetailsForDeliveryDate ¶
type TimeInTransitDetailsForDeliveryDate struct { PlannedShipDate *DateTime `json:"planned_ship_date,omitempty" url:"planned_ship_date,omitempty"` EasyPostEstimatedDeliveryDate *DateTime `json:"easypost_estimated_delivery_date,omitempty" url:"easypost_estimated_delivery_date,omitempty"` DaysInTransit *TimeInTransit `json:"days_in_transit,omitempty" url:"days_in_transit,omitempty"` }
TimeInTransitDetailsForDeliveryDate contains the time-in-transit details and estimated delivery date for a specific DeliveryDateForZipPairEstimate.
type TimeInTransitDetailsForShipDate ¶
type TimeInTransitDetailsForShipDate struct { DesiredDeliveryDate *DateTime `json:"desired_delivery_date,omitempty" url:"desired_delivery_date,omitempty"` EasyPostRecommendedShipDate *DateTime `json:"ship_on_date,omitempty" url:"ship_on_date,omitempty"` DeliveryDateConfidence float64 `json:"delivery_date_confidence,omitempty" url:"delivery_date_confidence,omitempty"` EstimatedTransitDays int `json:"estimated_transit_days,omitempty" url:"estimated_transit_days,omitempty"` DaysInTransit *TimeInTransit `json:"days_in_transit,omitempty" url:"days_in_transit,omitempty"` }
TimeInTransitDetailsForShipDate contains the time-in-transit details and estimated delivery date for a specific ShipDateForZipPairRecommendation or RecommendShipDateForShipmentResult.
type TimeoutError ¶
type TimeoutError struct {
APIError // subtype of APIError
}
TimeoutError is raised when the API returns a 408 status code.
func (*TimeoutError) Unwrap ¶
func (e *TimeoutError) Unwrap() error
Unwrap returns the underlying APIError error.
type Tracker ¶
type Tracker struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty" url:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty" url:"updated_at,omitempty"` TrackingCode string `json:"tracking_code,omitempty" url:"tracking_code,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` StatusDetail string `json:"status_detail,omitempty" url:"status_detail,omitempty"` SignedBy string `json:"signed_by,omitempty" url:"signed_by,omitempty"` Weight float64 `json:"weight,omitempty" url:"weight,omitempty"` EstDeliveryDate *DateTime `json:"est_delivery_date,omitempty" url:"est_delivery_date,omitempty"` ShipmentID string `json:"shipment_id,omitempty" url:"shipment_id,omitempty"` Carrier string `json:"carrier,omitempty" url:"carrier,omitempty"` TrackingDetails []*TrackingDetail `json:"tracking_details,omitempty" url:"tracking_details,omitempty"` CarrierDetail *TrackingCarrierDetail `json:"carrier_detail,omitempty" url:"carrier_detail,omitempty"` PublicURL string `json:"public_url,omitempty" url:"public_url,omitempty"` Fees []*Fee `json:"fees,omitempty" url:"fees,omitempty"` Finalized bool `json:"finalized,omitempty" url:"finalized,omitempty"` IsReturn bool `json:"is_return,omitempty" url:"is_return,omitempty"` }
A Tracker object contains all the tracking information for a package.
type TrackingCarrierDetail ¶
type TrackingCarrierDetail struct { Object string `json:"object,omitempty" url:"object,omitempty"` Service string `json:"service,omitempty" url:"service,omitempty"` ContainerType string `json:"container_type,omitempty" url:"container_type,omitempty"` EstDeliveryDateLocal string `json:"est_delivery_date_local,omitempty" url:"est_delivery_date_local,omitempty"` EstDeliveryTimeLocal string `json:"est_delivery_time_local,omitempty" url:"est_delivery_time_local,omitempty"` OriginLocation string `json:"origin_location,omitempty" url:"origin_location,omitempty"` OriginTrackingLocation *TrackingLocation `json:"origin_tracking_location,omitempty" url:"origin_tracking_location,omitempty"` DestinationLocation string `json:"destination_location,omitempty" url:"destination_location,omitempty"` DestinationTrackingLocation *TrackingLocation `json:"destination_tracking_location,omitempty" url:"destination_tracking_location,omitempty"` GuaranteedDeliveryDate *DateTime `json:"guaranteed_delivery_date,omitempty" url:"guaranteed_delivery_date,omitempty"` AlternateIdentifier string `json:"alternate_identifier,omitempty" url:"alternate_identifier,omitempty"` InitialDeliveryAttempt *DateTime `json:"initial_delivery_attempt,omitempty" url:"initial_delivery_attempt,omitempty"` }
TrackingCarrierDetail provides additional tracking information from the carrier, when available.
type TrackingDetail ¶
type TrackingDetail struct { Object string `json:"object,omitempty" url:"object,omitempty"` Message string `json:"message,omitempty" url:"message,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Status string `json:"status,omitempty" url:"status,omitempty"` StatusDetail string `json:"status_detail,omitempty" url:"status_detail,omitempty"` DateTime string `json:"datetime,omitempty" url:"datetime,omitempty"` Source string `json:"source,omitempty" url:"source,omitempty"` CarrierCode string `json:"carrier_code,omitempty" url:"carrier_code,omitempty"` TrackingLocation *TrackingLocation `json:"tracking_location,omitempty" url:"tracking_location,omitempty"` EstDeliveryDate *DateTime `json:"est_delivery_date,omitempty" url:"est_delivery_date,omitempty"` }
TrackingDetail provides information about a tracking event.
type TrackingLocation ¶
type TrackingLocation struct { Object string `json:"object,omitempty" url:"object,omitempty"` City string `json:"city,omitempty" url:"city,omitempty"` State string `json:"state,omitempty" url:"state,omitempty"` Country string `json:"country,omitempty" url:"country,omitempty"` Zip string `json:"zip,omitempty" url:"zip,omitempty"` }
TrackingLocation provides additional information about the location of a tracking event.
type UnauthorizedError ¶
type UnauthorizedError struct {
}UnauthorizedError is raised when the API returns a 401 status code.
func (*UnauthorizedError) Unwrap ¶
func (e *UnauthorizedError) Unwrap() error
Unwrap returns the underlying APIError error.
type UnknownHttpError ¶
type UnknownHttpError struct {
APIError // subtype of APIError
}
UnknownHttpError is raised when the API returns an unrecognized status code.
func (*UnknownHttpError) Unwrap ¶
func (e *UnknownHttpError) Unwrap() error
Unwrap returns the underlying APIError error.
type UpsCarrierAccountCreationParameters ¶
type UpsCarrierAccountCreationParameters struct { Type string `json:"type,omitempty" url:"type,omitempty"` Description string `json:"description,omitempty" url:"description,omitempty"` Reference string `json:"reference,omitempty" url:"reference,omitempty"` AccountNumber string `json:"account_number,omitempty" url:"account_number,omitempty"` }
UpsCarrierAccountCreationParameters contains the parameters needed to create a new UPS carrier account.
type UpsCarrierAccountUpdateParameters ¶
type UpsCarrierAccountUpdateParameters struct {
AccountNumber string `json:"account_number,omitempty" url:"account_number,omitempty"`
}
UpsCarrierAccountUpdateParameters contains the parameters needed to update a UPS carrier account.
type User ¶
type User struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` ParentID string `json:"parent_id,omitempty" url:"parent_id,omitempty"` Name string `json:"name,omitempty" url:"name,omitempty"` Email string `json:"email,omitempty" url:"email,omitempty"` PhoneNumber string `json:"phone_number,omitempty" url:"phone_number,omitempty"` Balance string `json:"balance,omitempty" url:"balance,omitempty"` RechargeAmount string `json:"recharge_amount,omitempty" url:"recharge_amount,omitempty"` SecondaryRechargeAmount string `json:"secondary_recharge_amount,omitempty" url:"secondary_recharge_amount,omitempty"` RechargeThreshold string `json:"recharge_threshold,omitempty" url:"recharge_threshold,omitempty"` Children []*User `json:"children,omitempty" url:"children,omitempty"` APIKeys []*APIKey `json:"api_keys,omitempty" url:"api_keys,omitempty"` Verified bool `json:"verified,omitempty" url:"verified,omitempty"` }
A User contains data about an EasyPost account and child accounts.
type UserOptions ¶
type UserOptions struct { ID string `json:"-"` // IGNORE Email *string `json:"email,omitempty" url:"email,omitempty"` Password *string `json:"password,omitempty" url:"password,omitempty"` PasswordConfirmation *string `json:"password_confirmation,omitempty" url:"password_confirmation,omitempty"` CurrentPassword *string `json:"current_password,omitempty" url:"current_password,omitempty"` Name *string `json:"name,omitempty" url:"name,omitempty"` Phone *string `json:"phone,omitempty" url:"phone,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` RechargeAmount *string `json:"recharge_amount,omitempty" url:"recharge_amount,omitempty"` SecondaryRechargeAmount *string `json:"secondary_recharge_amount,omitempty" url:"secondary_recharge_amount,omitempty"` RechargeThreshold *string `json:"recharge_threshold,omitempty" url:"recharge_threshold,omitempty"` }
UserOptions specifies options for creating or updating a user.
type Webhook ¶
type Webhook struct { ID string `json:"id,omitempty" url:"id,omitempty"` Object string `json:"object,omitempty" url:"object,omitempty"` Mode string `json:"mode,omitempty" url:"mode,omitempty"` URL string `json:"url,omitempty" url:"url,omitempty"` DisabledAt *DateTime `json:"disabled_at,omitempty" url:"disabled_at,omitempty"` WebhookSecret string `json:"webhook_secret,omitempty" url:"webhook_secret,omitempty"` CustomHeaders []WebhookCustomHeader `json:"custom_headers,omitempty" url:"custom_headers,omitempty"` }
A Webhook represents an EasyPost webhook callback URL.
type WebhookCustomHeader ¶
type WebhookCustomHeader struct { Name string `json:"name" url:"name"` Value string `json:"value" url:"value"` }
WebhookCustomHeader represents a custom header for an EasyPost webhook.
type WrappedLumaRequest ¶ added in v5.2.0
type WrappedLumaRequest struct {
Shipment *LumaRequest `json:"shipment,omitempty" url:"shipment,omitempty"`
}
WrappedLumaRequest is the request structure for retrieving Luma AI Promise.
Source Files
¶
- address.go
- api_key.go
- batch.go
- billing.go
- brand.go
- carrier.go
- carrier_message.go
- carrier_metadata.go
- claim.go
- client.go
- constants.go
- customs.go
- datetime.go
- endshipper.go
- error.go
- event.go
- fee.go
- hooks.go
- insurance.go
- list_options.go
- luma.go
- mocking.go
- object.go
- order.go
- paginated_collection.go
- parcel.go
- payment_log.go
- payment_method.go
- pickup.go
- rate.go
- referral_customer.go
- refund.go
- report.go
- scan_form.go
- shipment.go
- shipment_options.go
- smart_rate.go
- tax_identifier.go
- tracker.go
- user.go
- util.go
- version.go
- webhook.go