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 BadRequestError
- type Batch
- type BatchStatus
- type BetaPaymentRefund
- type Brand
- type CarbonOffset
- type CarrierAccount
- type CarrierField
- type CarrierFields
- type CarrierMessage
- type CarrierMetadata
- type CarrierType
- type Client
- func (c *Client) AddReferralCustomerCreditCard(referralCustomerApiKey string, creditCardOptions *CreditCardOptions, ...) (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) 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) 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) BuyShipmentWithCarbonOffset(shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithCarbonOffsetAndEndShipper(shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithCarbonOffsetAndEndShipperWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string, ...) (out *Shipment, err error)
- func (c *Client) BuyShipmentWithCarbonOffsetWithContext(ctx context.Context, 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) 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) CreateAndBuyBatch(in ...*Shipment) (out *Batch, err error)
- func (c *Client) CreateAndBuyBatchWithContext(ctx context.Context, in ...*Shipment) (out *Batch, 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) 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) 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) CreateShipmentWithCarbonOffset(in *Shipment) (out *Shipment, err error)
- func (c *Client) CreateShipmentWithCarbonOffsetWithContext(ctx context.Context, 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) CreateTrackerList(param map[string]interface{}) (bool, error)
- func (c *Client) CreateTrackerListWithContext(ctx context.Context, param map[string]interface{}) (bool, error)
- func (c *Client) CreateTrackerWithContext(ctx context.Context, opts *CreateTrackerOptions) (out *Tracker, 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) CreateWebhookWithDetails(data *CreateUpdateWebhookOptions) (out *Webhook, err error)
- func (c *Client) CreateWebhookWithDetailsWithContext(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) 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) 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) 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) 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) 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, 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) 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) 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) RerateShipmentWithCarbonOffset(shipmentID string) (out []*Rate, err error)
- func (c *Client) RerateShipmentWithCarbonOffsetWithContext(ctx context.Context, 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(params map[string]interface{}, userID string) (out *Brand, err error)
- func (c *Client) UpdateBrandWithContext(ctx context.Context, params map[string]interface{}, userID string) (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) 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 CreateTrackerOptions
- type CreateUpdateWebhookOptions
- type CreditCardOptions
- type CustomsInfo
- type CustomsItem
- type DateTime
- type EasyPostTimeInTransitData
- type Error
- type EstimatedDeliveryDate
- type Event
- type EventPayload
- type ExternalApiError
- type Fee
- 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 InvalidObjectError
- type InvalidRequestError
- type LibraryError
- type ListAddressResult
- type ListBatchesResult
- 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 MetadataPredefinedPackage
- type MetadataServiceLevel
- type MetadataShipmentOption
- type MetadataSupportedFeature
- type MethodNotAllowedError
- type MinifiedRate
- type MissingPropertyError
- 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 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 Shipment
- type ShipmentOptions
- type SmartRate
- type StatelessRate
- type TaxIdentifier
- type TimeInTransit
- type TimeoutError
- type Tracker
- type TrackingCarrierDetail
- type TrackingDetail
- type TrackingLocation
- type UnauthorizedError
- type UnknownHttpError
- type User
- type UserOptions
- type Webhook
Constants ¶
const Version = "3.0.1"
Variables ¶
var ApiDidNotReturnErrorDetails = "API did not return error details"
var ApiErrorDetailsParsingError = "RESPONSE.PARSE_ERROR"
var EndOfPaginationError = &LocalError{LibraryError{Message: NoPagesLeftToRetrieve}}
EndOfPaginationError is raised when there are no more pages to retrieve.
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 MismatchWebhookSignatureError = &LocalError{LibraryError{Message: MismatchWebhookSignature}}
MismatchWebhookSignatureError is raised when a 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 MissingWebhookSignatureError = &LocalError{LibraryError{Message: MissingWebhookSignature}}
MissingWebhookSignatureError is raised when a 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 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 // Code is a machine-readable status of the problem encountered. Code string // 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 []*Error `json:"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.
This is different from the Error class, which represents information about what triggered the failed request.
The information from the top-level Error class 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"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` Key string `json:"key,omitempty"` }
APIKey represents a single API key.
type APIKeys ¶
type APIKeys struct { ID string `json:"id,omitempty"` Children []*APIKeys `json:"children,omitempty"` Keys []*APIKey `json:"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"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Street1 string `json:"street1,omitempty"` Street2 string `json:"street2,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Zip string `json:"zip,omitempty"` Country string `json:"country,omitempty"` Name string `json:"name,omitempty"` Company string `json:"company,omitempty"` Phone string `json:"phone,omitempty"` Email string `json:"email,omitempty"` Residential bool `json:"residential,omitempty"` CarrierFacility string `json:"carrier_facility,omitempty"` FederalTaxID string `json:"federal_tax_id,omitempty"` StateTaxID string `json:"state_tax_id,omitempty"` Verifications *AddressVerifications `json:"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"` Errors []*AddressVerificationFieldError `json:"errors"` Details *AddressVerificationDetails `json:"details"` }
AddressVerification holds data relating to address verification status.
type AddressVerificationDetails ¶
type AddressVerificationDetails struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` TimeZone string `json:"time_zone"` }
AddressVerificationDetails contains extra information related to address verification.
type AddressVerificationFieldError ¶
type AddressVerificationFieldError struct { Code string `json:"code,omitempty"` Field string `json:"field,omitempty"` Message string `json:"message,omitempty"` Suggestion string `json:"suggestion,omitempty"` }
AddressVerificationFieldError provides additional information on address validation errors.
type AddressVerifications ¶
type AddressVerifications struct { ZIP4 *AddressVerification `json:"zip4"` Delivery *AddressVerification `json:"delivery"` }
AddressVerifications contains the result of the requested address verifications.
type AddressVerifyResponse ¶
type AddressVerifyResponse struct {
Address *Address `json:"address,omitempty"`
}
type BadRequestError ¶
type BadRequestError struct {
APIError
}
BadRequestError is raised when the API returns a 400 status code.
type Batch ¶
type Batch struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` State string `json:"state,omitempty"` NumShipments int `json:"num_shipments,omitempty"` Shipments []*Shipment `json:"shipments,omitempty"` Status *BatchStatus `json:"status,omitempty"` LabelURL string `json:"label_url,omitempty"` ScanForm *ScanForm `json:"scan_form,omitempty"` Pickup *Pickup `json:"pickup,omitempty"` }
Batch represents a batch of shipments.
type BatchStatus ¶
type BatchStatus struct { PostagePurchased int `json:"postage_purchased,omitempty"` PostagePurchaseFailed int `json:"postage_purchase_failed,omitempty"` QueuedForPurchase int `json:"queued_for_purchase,omitempty"` CreationFailed int `json:"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"` RefundedPaymentLogs []string `json:"refunded_payment_log,omitempty"` PaymentLogId string `json:"payment_log_id,omitempty"` Errors []APIError `json:"errors,omitempty"` }
A BetaPaymentRefund that has the refund details for the refund request.
type Brand ¶
type Brand struct { ID string `json:"id,omitempty"` BackgroundColor string `json:"background_color,omitempty"` Color string `json:"color,omitempty"` Logo string `json:"logo,omitempty"` LogoHref string `json:"logo_href,omitempty"` Ad string `json:"ad,omitempty"` AdHref string `json:"ad_href,omitempty"` Name string `json:"name,omitempty"` UserID string `json:"user_id,omitempty"` Theme string `json:"theme,omitempty"` }
Brand contains data for a user brand
type CarbonOffset ¶
type CarbonOffset struct { Object string `json:"object,omitempty"` Currency string `json:"currency,omitempty"` Grams int64 `json:"grams,omitempty"` Price string `json:"price,omitempty"` }
CarbonOffset objects contain carbon offset details for a rate.
type CarrierAccount ¶
type CarrierAccount struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Type string `json:"type,omitempty"` Fields *CarrierFields `json:"fields,omitempty"` Clone bool `json:"clone,omitempty"` Description string `json:"description,omitempty"` Readable string `json:"readable,omitempty"` Credentials map[string]string `json:"credentials,omitempty"` TestCredentials map[string]string `json:"test_credentials,omitempty"` RegistrationData map[string]interface{} `json:"registration_data,omitempty"` BillingType string `json:"billing_type,omitempty"` }
CarrierAccount encapsulates credentials and other information related to a carrier account.
type CarrierField ¶
type CarrierField struct { Visibility string `json:"visibility,omitempty"` Label string `json:"label,omitempty"` Value string `json:"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"` TestCredentials map[string]*CarrierField `json:"test_credentials,omitempty"` AutoLink bool `json:"auto_link,omitempty"` CustomWorkflow bool `json:"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"` Type string `json:"type,omitempty"` Message string `json:"message,omitempty"` CarrierAccountID string `json:"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"` HumanReadable string `json:"human_readable,omitempty"` ServiceLevels []*MetadataServiceLevel `json:"service_levels,omitempty"` PredefinedPackages []*MetadataPredefinedPackage `json:"predefined_packages,omitempty"` ShipmentOptions []*MetadataShipmentOption `json:"shipment_options,omitempty"` SupportedFeatures []*MetadataSupportedFeature `json:"supported_features,omitempty"` }
CarrierMetadata represents all the metadata for a carrier.
type CarrierType ¶
type CarrierType struct { Object string `json:"object,omitempty"` Type string `json:"type,omitempty"` Fields *CarrierFields `json:"fields,omitempty"` }
CarrierType contains information on a supported carrier. It can be used to determine the valid fields for a carrier account.
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) AddReferralCustomerCreditCard ¶
func (c *Client) AddReferralCustomerCreditCard(referralCustomerApiKey string, creditCardOptions *CreditCardOptions, priority PaymentMethodPriority) (out *PaymentMethodObject, err error)
AddReferralCustomerCreditCard adds a credit card to a referral customer's account.
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) 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)
BetaRefundByAmount refunds a payment by paymenbt 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) 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) BuyShipmentWithCarbonOffset ¶
func (c *Client) BuyShipmentWithCarbonOffset(shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
BuyShipmentWithCarbonOffset performs the same operation as BuyShipment, but includes a carbon offset.
func (*Client) BuyShipmentWithCarbonOffsetAndEndShipper ¶
func (c *Client) BuyShipmentWithCarbonOffsetAndEndShipper(shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
BuyShipmentWithCarbonOffsetAndEndShipper performs the same operation as BuyShipment, but includes a carbon offset and an EndShipper ID.
func (*Client) BuyShipmentWithCarbonOffsetAndEndShipperWithContext ¶
func (c *Client) BuyShipmentWithCarbonOffsetAndEndShipperWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string, endShipperID string) (out *Shipment, err error)
BuyShipmentWithCarbonOffsetAndEndShipperWithContext performs the same operation as BuyShipmentWithCarbonOffsetAndEndShipper, but allows specifying a context that can interrupt the request.
func (*Client) BuyShipmentWithCarbonOffsetWithContext ¶
func (c *Client) BuyShipmentWithCarbonOffsetWithContext(ctx context.Context, shipmentID string, rate *Rate, insurance string) (out *Shipment, err error)
BuyShipmentWithCarbonOffsetWithContext performs the same operation as BuyShipmentWithCarbonOffset, but allows specifying a context that can interrupt the request.
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) 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) CreateAndBuyBatch ¶
CreateAndBuyBatch creates and buys a new batch of shipments in one request.
func (*Client) CreateAndBuyBatchWithContext ¶
func (c *Client) CreateAndBuyBatchWithContext(ctx context.Context, in ...*Shipment) (out *Batch, err error)
CreateAndBuyBatchWithContext performs the same operation as CreateAndBuyBatch, 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: "UpsAccount", Description: "NY Location UPS Account", Reference: "my reference", Credentials: map[string]string{ "user_id": "USERID", "password": "PASSWORD", "access_license_number": "ALN", }, }, )
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.
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) 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) CreateShipmentWithCarbonOffset ¶
CreateShipmentWithCarbonOffset performs the same operation as CreateShipment, but includes a carbon offset.
func (*Client) CreateShipmentWithCarbonOffsetWithContext ¶
func (c *Client) CreateShipmentWithCarbonOffsetWithContext(ctx context.Context, in *Shipment) (out *Shipment, err error)
CreateShipmentWithCarbonOffsetWithContext performs the same operation as CreateShipmentWithCarbonOffset, but allows specifying a context that can interrupt the request.
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) CreateTrackerList ¶
CreateTrackerList asynchronously creates multiple trackers. Input a map of maps that contains multiple tracking codes
func (*Client) CreateTrackerListWithContext ¶
func (c *Client) CreateTrackerListWithContext(ctx context.Context, param map[string]interface{}) (bool, error)
CreateTrackerListWithContext performs the same operation as CreateTrackerList, but allows specifying a context that can interrupt the request.
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) 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) CreateWebhookWithDetails ¶
func (c *Client) CreateWebhookWithDetails(data *CreateUpdateWebhookOptions) (out *Webhook, err error)
CreateWebhookWithDetails creates a new webhook with the provided details.
func (*Client) CreateWebhookWithDetailsWithContext ¶
func (c *Client) CreateWebhookWithDetailsWithContext(ctx context.Context, data *CreateUpdateWebhookOptions) (out *Webhook, err error)
CreateWebhookWithDetailsWithContext performs the same operation as CreateWebhookWithDetails, 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) 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) 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)
GetCarrierMetadataWithTypes 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) 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) 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) 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, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
GetShipmentEstimatedDeliveryDate retrieves the estimated delivery date of each Rate via SmartRate.
func (*Client) GetShipmentEstimatedDeliveryDateWithContext ¶
func (c *Client) GetShipmentEstimatedDeliveryDateWithContext(ctx context.Context, shipmentID string, plannedShipDate string) (out []*EstimatedDeliveryDate, err error)
GetShipmentEstimatedDeliveryDateWithContext performs the same operation as GetShipmentEstimatedDeliveryDate, 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) 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) 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) RerateShipmentWithCarbonOffset ¶
RerateShipmentWithCarbonOffset performs the same operation as RerateShipment, but includes a carbon offset.
func (*Client) RerateShipmentWithCarbonOffsetWithContext ¶
func (c *Client) RerateShipmentWithCarbonOffsetWithContext(ctx context.Context, shipmentID string) (out []*Rate, err error)
RerateShipmentWithCarbonOffsetWithContext performs the same operation as RerateShipmentWithCarbonOffset, but allows specifying a context that can interrupt the request.
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, params map[string]interface{}, userID string) (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_1001", Description: "FL Location UPS Account", Credentials: map[string]string{ "account_number": "B2B2B2", }, }, )
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.
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) 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
}
ConnectionError is raised when the API returns a 0 status code.
type CreateAddressOptions ¶
type CreateAddressOptions struct { Verify []string `json:"verify,omitempty"` VerifyStrict []string `json:"verify_strict,omitempty"` }
CreateAddressOptions is used to specify verification options for address creation.
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"` WebhookSecret string `json:"webhook_secret,omitempty"` }
CreateUpdateWebhookOptions is used to specify parameters for creating and updating EasyPost webhooks.
type CreditCardOptions ¶
type CreditCardOptions struct { Number string `json:"number,omitempty"` ExpMonth string `json:"expiration_month,omitempty"` ExpYear string `json:"expiration_year,omitempty"` Cvc string `json:"cvc,omitempty"` }
CreditCardOptions specifies options for creating or updating a credit card.
type CustomsInfo ¶
type CustomsInfo struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` EELPFC string `json:"eel_pfc,omitempty"` ContentsType string `json:"contents_type,omitempty"` ContentsExplanation string `json:"contents_explanation,omitempty"` CustomsCertify bool `json:"customs_certify,omitempty"` CustomsSigner string `json:"customs_signer,omitempty"` NonDeliveryOption string `json:"non_delivery_option,omitempty"` RestrictionType string `json:"restriction_type,omitempty"` CustomsItems []*CustomsItem `json:"customs_items,omitempty"` Declaration string `json:"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"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Description string `json:"description,omitempty"` Quantity float64 `json:"quantity,omitempty"` Value float64 `json:"value,omitempty,string"` Weight float64 `json:"weight,omitempty"` HSTariffNumber string `json:"hs_tariff_number,omitempty"` Code string `json:"code,omitempty"` OriginCountry string `json:"origin_country,omitempty"` Currency string `json:"currency,omitempty"` }
A CustomsItem object describes goods for international shipment.
type DateTime ¶
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) MarshalJSON ¶
func (*DateTime) UnmarshalJSON ¶
type EasyPostTimeInTransitData ¶
type EasyPostTimeInTransitData struct { DaysInTransit TimeInTransit `json:"days_in_transit,omitempty"` EasyPostEstimatedDeliveryDate string `json:"easypost_estimated_delivery_date,omitempty"` PlannedShipDate string `json:"planned_ship_date,omitempty"` }
type Error ¶
type Error struct { // Code is a machine-readable code of the problem encountered. Code string `json:"code,omitempty"` // Errors may be provided if there are multiple errors, for example if // multiple fields have invalid values. Errors []*Error `json:"errors,omitempty"` // Field may be provided when the error relates to a specific field. Field string `json:"field,omitempty"` // Message is a human-readable description of the problem encountered. Message interface{} `json:"message,omitempty"` // Suggestion may be provided if the API can provide a suggestion to fix // the error. Suggestion string `json:"suggestion,omitempty"` }
Error represents an Error object returned by the EasyPost API.
These are typically informational about why a request failed (server-side validation issues, missing data, etc.).
This is different from the LibraryError class, which represents exceptions in the EasyPost library, such as bad HTTP status codes or local validation issues.
func (*Error) Error ¶
Error provides a pretty printed string of an Error object based on present data.
func (*Error) UnmarshalJSON ¶
type EstimatedDeliveryDate ¶
type EstimatedDeliveryDate struct { EasyPostTimeInTransitData EasyPostTimeInTransitData `json:"easypost_time_in_transit_data,omitempty"` Rate SmartRate `json:"rate,omitempty"` }
type Event ¶
type Event struct { ID string `json:"id,omitempty"` UserID string `json:"user_id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Description string `json:"description,omitempty"` PreviousAttributes map[string]interface{} `json:"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"` Status string `json:"status,omitempty"` PendingURLs []string `json:"pending_urls,omitempty"` CompletedURLs []string `json:"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"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` RequestURL string `json:"request_url,omitempty"` RequestHeaders map[string]string `json:"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"` ResponseHeaders map[string]string `json:"response_headers,omitempty"` ResponseBody string `json:"response_body,omitempty"` ResponseCode int `json:"response_code,omitempty"` TotalTime int `json:"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
}
ExternalApiError represents an error caused by an external API, such as a 3rd party HTTP API (not EasyPost).
type Fee ¶
type Fee struct { Object string `json:"object,omitempty"` Type string `json:"type,omitempty"` Amount string `json:"amount,omitempty"` Charged bool `json:"charged,omitempty"` Refunded bool `json:"refunded,omitempty"` }
Fee objects are used to represent the breakdown of charges made when purchasing an item on EasyPost.
type FilteringError ¶
type FilteringError struct {
LocalError
}
FilteringError is raised when there is an issue while running a filtering operation.
type ForbiddenError ¶
type ForbiddenError struct {
APIError
}
ForbiddenError is raised when the API returns a 403 status code.
type Form ¶
type Form struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` FormType string `json:"form_type,omitempty"` FormURL string `json:"form_url,omitempty"` SubmittedElectronically bool `json:"submitted_electronically,omitempty"` }
A Form represents a form associated with a Shipment.
type GatewayTimeoutError ¶
type GatewayTimeoutError struct {
APIError
}
GatewayTimeoutError is raised when the API returns a 504 status code.
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"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Amount string `json:"amount,omitempty"` Carrier string `json:"carrier,omitempty"` Provider string `json:"provider,omitempty"` ProviderID string `json:"provider_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty"` TrackingCode string `json:"tracking_code,omitempty"` Status string `json:"status,omitempty"` Tracker *Tracker `json:"tracker,omitempty"` ToAddress *Address `json:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty"` Fee *Fee `json:"fee,omitempty"` Messages []string `json:"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
}
InternalServerError is raised when the API returns a 500 status code.
type InvalidObjectError ¶
type InvalidObjectError struct {
LocalError
}
InvalidObjectError is raised when an object is invalid.
type InvalidRequestError ¶
type InvalidRequestError struct {
APIError
}
InvalidRequestError is raised when the API returns a 422 status code.
type LibraryError ¶
type LibraryError struct { // Message is a human-readable error description. Message string }
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.
type ListAddressResult ¶
type ListAddressResult struct { Addresses []*Address `json:"addresses,omitempty"` PaginatedCollection }
ListAddressResult holds the results from the list addresses API.
type ListBatchesResult ¶
type ListBatchesResult struct { Batch []*Batch `json:"batches,omitempty"` PaginatedCollection }
ListBatchesResult holds the results from the list insurances API.
type ListEndShipperResult ¶
type ListEndShipperResult struct { EndShippers []*Address `json:"endshippers,omitempty"` HasMore bool `json:"has_more,omitempty"` }
ListEndShipperResult holds the results from the list EndShippers API.
type ListEventsResult ¶
type ListEventsResult struct { Events []*Event `json:"events,omitempty"` PaginatedCollection }
ListEventsResult holds the results from the list events API.
type ListInsurancesResult ¶
type ListInsurancesResult struct { Insurances []*Insurance `json:"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"` PaginatedCollection }
ListPickupResult holds the results from the list Pickup API.
type ListReferralCustomersResult ¶
type ListReferralCustomersResult struct { ReferralCustomers []*ReferralCustomer `json:"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"` PaginatedCollection }
type ListReportsResult ¶
type ListReportsResult struct { Reports []*Report `json:"reports,omitempty"` Type string `json:"type,omitempty"` PaginatedCollection }
ListReportsResult holds the results from the list reports API.
type ListScanFormsResult ¶
type ListScanFormsResult struct { ScanForms []*ScanForm `json:"scan_forms,omitempty"` PaginatedCollection }
ListScanFormsResult holds the results from the list scan forms API.
type ListShipmentsOptions ¶
type ListShipmentsOptions 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"` Purchased *bool `url:"purchased,omitempty"` IncludeChildren *bool `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"` Purchased *bool `json:"purchased,omitempty"` IncludeChildren *bool `json:"include_children,omitempty"` PaginatedCollection }
ListShipmentsResult holds the results from the list shipments API.
type ListTrackersOptions ¶
type ListTrackersOptions 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"` TrackingCode string `url:"tracking_code,omitempty"` Carrier string `url:"carrier,omitempty"` }
ListTrackersOptions is used to specify query parameters for listing Tracker objects.
type ListTrackersResult ¶
type ListTrackersResult struct { Trackers []*Tracker `json:"trackers,omitempty"` TrackingCode string `json:"tracking_code,omitempty"` Carrier string `json:"carrier,omitempty"` PaginatedCollection }
ListTrackersResult holds the results from the list trackers API.
type ListTrackersUpdatedOptions ¶
type ListTrackersUpdatedOptions struct { Page int `json:"page,omitempty"` PageSize int `json:"page_size,omitempty"` StatusStart *DateTime `json:"status_start,omitempty"` StatusEnd *DateTime `json:"status_end,omitempty"` TrackingDetailsStart *DateTime `json:"tracking_details_start,omitempty"` TrackingDetailsEnd *DateTime `json:"tracking_details_end,omitempty"` }
ListTrackersUpdatedOptions specifies options for the list trackers updated API.
type LocalError ¶
type LocalError struct {
LibraryError
}
LocalError represents an error caused by the EasyPost library itself, such as validation or JSON serialization issues.
type MetadataPredefinedPackage ¶
type MetadataPredefinedPackage struct { Name string `json:"name,omitempty"` Carrier string `json:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty"` Description string `json:"description,omitempty"` Dimensions []string `json:"dimensions,omitempty"` MaxWeight float64 `json:"max_weight,omitempty"` }
MetadataPredefinedPackage represents an available predefined package of a carrier.
type MetadataServiceLevel ¶
type MetadataServiceLevel struct { Name string `json:"name,omitempty"` Carrier string `json:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty"` Description string `json:"description,omitempty"` Dimensions []string `json:"dimensions,omitempty"` MaxWeight float64 `json:"max_weight,omitempty"` }
MetadataServiceLevel represents an available service level of a carrier.
type MetadataShipmentOption ¶
type MetadataShipmentOption struct { Name string `json:"name,omitempty"` Carrier string `json:"carrier,omitempty"` HumanReadable string `json:"human_readable,omitempty"` Description string `json:"description,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Type string `json:"type,omitempty"` }
MetadataShipmentOption represents an available shipment option of a carrier.
type MetadataSupportedFeature ¶
type MetadataSupportedFeature struct { Name string `json:"name,omitempty"` Carrier string `json:"carrier,omitempty"` Description string `json:"description,omitempty"` Supported bool `json:"supported,omitempty"` }
MetadataSupportedFeature represents a supported feature of a carrier.
type MethodNotAllowedError ¶
type MethodNotAllowedError struct {
APIError
}
MethodNotAllowedError is raised when the API returns a 405 status code.
type MinifiedRate ¶
type MissingPropertyError ¶
type MissingPropertyError struct {
LocalError
}
MissingPropertyError is raised when a required property is missing.
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
}
NotFoundError is raised when the API returns a 404 status code.
type Order ¶
type Order struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` ToAddress *Address `json:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty"` ReturnAddress *Address `json:"return_address,omitempty"` BuyerAddress *Address `json:"buyer_address,omitempty"` Shipments []*Shipment `json:"shipments,omitempty"` Rates []*Rate `json:"rates,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty"` IsReturn bool `json:"is_return"` Service string `json:"service,omitempty"` CustomsInfo *CustomsInfo `json:"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"` }
PaginatedCollection holds the results of a paginated API response.
type Parcel ¶
type Parcel struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Length float64 `json:"length,omitempty"` Width float64 `json:"width,omitempty"` Height float64 `json:"height,omitempty"` PredefinedPackage string `json:"predefined_package,omitempty"` Weight float64 `json:"weight,omitempty"` }
A Parcel objects represent a physical container being shipped.
type Payment ¶
type Payment struct { Type string `json:"type,omitempty"` Account string `json:"account,omitempty"` Country string `json:"country,omitempty"` PostalCode string `json:"postal_code,omitempty"` }
Payment provides information on how a shipment is billed.
type PaymentError ¶
type PaymentError struct {
APIError
}
PaymentError is raised when the API returns a 402 status code.
type PaymentLog ¶
type PaymentLog struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` SourceType string `json:"source_type,omitempty"` TargetType string `json:"target_type,omitempty"` Date string `json:"date,omitempty"` ChargeType string `json:"charge_type,omitempty"` Status string `json:"status,omitempty"` Amount string `json:"amount,omitempty"` Last4 string `json:"last4,omitempty"` }
type PaymentMethod ¶
type PaymentMethod struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` PrimaryPaymentMethod *PaymentMethodObject `json:"primary_payment_method,omitempty"` SecondaryPaymentMethod *PaymentMethodObject `json:"secondary_payment_method,omitempty"` }
type PaymentMethodObject ¶
type PaymentMethodObject struct { BankName string `json:"bank_name,omitempty"` // bank account Brand string `json:"brand,omitempty"` // credit card Country string `json:"country,omitempty"` // bank account DisabledAt string `json:"disabled_at,omitempty"` // both ExpirationMonth int `json:"exp_month,omitempty"` // credit card ExpirationYear int `json:"exp_year,omitempty"` // credit card ID string `json:"id,omitempty"` // both Last4 string `json:"last4,omitempty"` // both Name string `json:"name,omitempty"` // credit card Object string `json:"object,omitempty"` // both Verified bool `json:"verified,omitempty"` // bank account }
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"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Status string `json:"status,omitempty"` MinDatetime *DateTime `json:"min_datetime,omitempty"` MaxDatetime *DateTime `json:"max_datetime,omitempty"` IsAccountAddress bool `json:"is_account_address,omitempty"` Instructions string `json:"instructions,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty"` Confirmation string `json:"confirmation,omitempty"` Shipment *Shipment `json:"shipment,omitempty"` Address *Address `json:"address,omitempty"` Batch *Batch `json:"batch,omitempty"` CarrierAccounts []*CarrierAccount `json:"carrier_accounts,omitempty"` PickupRates []*PickupRate `json:"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"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Service string `json:"service,omitempty"` Carrier string `json:"carrier,omitempty"` Rate string `json:"rate,omitempty"` Currency string `json:"currency,omitempty"` PickupID string `json:"pickup_id,omitempty"` }
PickupRate contains data about the cost of a pickup.
type PostageLabel ¶
type PostageLabel struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` IntegratedForm string `json:"integrated_form,omitempty"` LabelDate *DateTime `json:"label_date,omitempty"` LabelEPL2URL string `json:"label_epl2_url,omitempty"` LabelFileType string `json:"label_file_type,omitempty"` LabelPDFURL string `json:"label_pdf_url,omitempty"` LabelResolution float64 `json:"label_resolution,omitempty"` LabelSize string `json:"label_size,omitempty"` LabelType string `json:"label_type,omitempty"` LabelURL string `json:"label_url,omitempty"` LabelZPLURL string `json:"label_zpl_url,omitempty"` }
PostageLabel provides details of a shipping label for a purchased shipment.
type ProxyError ¶
type ProxyError struct {
APIError
}
ProxyError is raised when the API returns a 407 status code.
type Rate ¶
type Rate struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Service string `json:"service,omitempty"` Carrier string `json:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty"` Rate string `json:"rate,omitempty"` Currency string `json:"currency,omitempty"` RetailRate string `json:"retail_rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty"` ListRate string `json:"list_rate,omitempty"` ListCurrency string `json:"list_currency,omitempty"` DeliveryDays int `json:"delivery_days,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty"` BillingType string `json:"billing_type,omitempty"` CarbonOffset *CarbonOffset `json:"carbon_offset,omitempty"` }
A Rate contains information on shipping cost and delivery time.
type RateLimitError ¶
type RateLimitError struct {
APIError
}
RateLimitError is raised when the API returns a 429 status code.
type RedirectError ¶
type RedirectError struct {
APIError
}
RedirectError is raised when the API returns a 3xx status code.
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"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` TrackingCode string `json:"tracking_code,omitempty"` ConfirmationNumber string `json:"confirmation_number,omitempty"` Status string `json:"status,omitempty"` Carrier string `json:"carrier,omitempty"` ShipmentID string `json:"shipment_id,omitempty"` }
type Report ¶
type Report struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Status string `json:"status,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` IncludeChildren bool `json:"include_children,omitempty"` URL string `json:"url,omitempty"` URLExpiresAt *DateTime `json:"url_expires_at,omitempty"` SendEmail bool `json:"send_email,omitempty"` Columns []string `json:"columns,omitempty"` AdditionalColumns []string `json:"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
}
RetryError is raised when the API returns a 1xx status code.
type SSLError ¶
type SSLError struct {
APIError
}
SSLError is raised when there is an issue with the SSL certificate.
type ScanForm ¶
type ScanForm struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` Address *Address `json:"address,omitempty"` TrackingCodes []string `json:"tracking_codes,omitempty"` FormURL string `json:"form_url,omitempty"` FormFileType string `json:"form_file_type,omitempty"` BatchID string `json:"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.
type Shipment ¶
type Shipment struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Reference string `json:"reference,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` ToAddress *Address `json:"to_address,omitempty"` FromAddress *Address `json:"from_address,omitempty"` ReturnAddress *Address `json:"return_address,omitempty"` BuyerAddress *Address `json:"buyer_address,omitempty"` Parcel *Parcel `json:"parcel,omitempty"` Carrier string `json:"carrier,omitempty"` Service string `json:"service,omitempty"` CarrierAccountIDs []string `json:"carrier_accounts,omitempty"` CustomsInfo *CustomsInfo `json:"customs_info,omitempty"` ScanForm *ScanForm `json:"scan_form,omitempty"` Forms []*Form `json:"forms,omitempty"` Insurance string `json:"insurance,omitempty"` Rates []*Rate `json:"rates,omitempty"` SelectedRate *Rate `json:"selected_rate,omitempty"` PostageLabel *PostageLabel `json:"postage_label,omitempty"` Messages []*CarrierMessage `json:"messages,omitempty"` Options *ShipmentOptions `json:"options,omitempty"` IsReturn bool `json:"is_return,omitempty"` TrackingCode string `json:"tracking_code,omitempty"` USPSZone int `json:"usps_zone,omitempty"` Status string `json:"status,omitempty"` Tracker *Tracker `json:"tracker,omitempty"` Fees []*Fee `json:"fees,omitempty"` RefundStatus string `json:"refund_status,omitempty"` BatchID string `json:"batch_id,omitempty"` BatchStatus string `json:"batch_status,omitempty"` BatchMessage string `json:"batch_message,omitempty"` TaxIdentifiers []*TaxIdentifier `json:"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"` AddressValidationLevel string `json:"address_validation_level,omitempty"` Alcohol bool `json:"alcohol,omitempty"` BillingRef string `json:"billing_ref,omitempty"` BillReceiverAccount string `json:"bill_receiver_account,omitempty"` BillReceiverPostalCode string `json:"bill_receiver_postal_code,omitempty"` BillThirdPartyAccount string `json:"bill_third_party_account,omitempty"` BillThirdPartyCountry string `json:"bill_third_party_country,omitempty"` BillThirdPartyPostalCode string `json:"bill_third_party_postal_code,omitempty"` ByDrone bool `json:"by_drone,omitempty"` CarbonNeutral bool `json:"carbon_neutral,omitempty"` CertifiedMail bool `json:"certified_mail,omitempty"` CODAmount string `json:"cod_amount,omitempty"` CODMethod string `json:"cod_method,omitempty"` CODAddressID string `json:"cod_address_id,omitempty"` Currency string `json:"currency,omitempty"` DeliveryConfirmation string `json:"delivery_confirmation,omitempty"` DeliveryMaxDatetime *DateTime `json:"delivery_max_datetime,omitempty"` DutyPayment *Payment `json:"duty_payment,omitempty"` DutyPaymentAccount string `json:"duty_payment_account,omitempty"` DropoffType string `json:"dropoff_type,omitempty"` DryIce bool `json:"dry_ice,omitempty"` DryIceMedical bool `json:"dry_ice_medical,omitempty,string"` DryIceWeight float64 `json:"dry_ice_weight,omitempty,string"` Endorsement string `json:"endorsement,omitempty"` EndShipperID string `json:"end_shipper_id,omitempty"` FreightCharge float64 `json:"freight_charge,omitempty"` HandlingInstructions string `json:"handling_instructions,omitempty"` Hazmat string `json:"hazmat,omitempty"` HoldForPickup bool `json:"hold_for_pickup,omitempty"` Incoterm string `json:"incoterm,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"` LabelDate *DateTime `json:"label_date,omitempty"` LabelFormat string `json:"label_format,omitempty"` LabelSize string `json:"label_size,omitempty"` Machinable bool `json:"machinable,omitempty"` Payment *Payment `json:"payment,omitempty"` PickupMinDatetime *DateTime `json:"pickup_min_datetime,omitempty"` PrintCustom1 string `json:"print_custom_1,omitempty"` PrintCustom2 string `json:"print_custom_2,omitempty"` PrintCustom3 string `json:"print_custom_3,omitempty"` PrintCustom1BarCode bool `json:"print_custom_1_barcode,omitempty"` PrintCustom2BarCode bool `json:"print_custom_2_barcode,omitempty"` PrintCustom3BarCode bool `json:"print_custom_3_barcode,omitempty"` PrintCustom1Code string `json:"print_custom_1_code,omitempty"` PrintCustom2Code string `json:"print_custom_2_code,omitempty"` PrintCustom3Code string `json:"print_custom_3_code,omitempty"` RegisteredMail bool `json:"registered_mail,omitempty"` RegisteredMailAmount float64 `json:"registered_mail_amount,omitempty"` ReturnReceipt bool `json:"return_receipt,omitempty"` SaturdayDelivery bool `json:"saturday_delivery,omitempty"` SpecialRatesEligibility string `json:"special_rates_eligibility,omitempty"` SmartpostHub string `json:"smartpost_hub,omitempty"` SmartpostManifest string `json:"smartpost_manifest,omitempty"` SuppressETD bool `json:"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"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` Service string `json:"service,omitempty"` Carrier string `json:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty"` ShipmentID string `json:"shipment_id,omitempty"` Rate float64 `json:"rate,omitempty"` Currency string `json:"currency,omitempty"` RetailRate float64 `json:"retail_rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty"` ListRate float64 `json:"list_rate,omitempty"` ListCurrency string `json:"list_currency,omitempty"` DeliveryDays int `json:"delivery_days,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty"` TimeInTransit *TimeInTransit `json:"time_in_transit,omitempty"` BillingType string `json:"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"` Carrier string `json:"carrier,omitempty"` CarrierAccountID string `json:"carrier_account_id,omitempty"` Currency string `json:"currency,omitempty"` DeliveryDate *DateTime `json:"delivery_date,omitempty"` DeliveryDateGuaranteed bool `json:"delivery_date_guaranteed,omitempty"` DeliveryDays int `json:"delivery_days,omitempty"` EstDeliveryDays int `json:"est_delivery_days,omitempty"` ListCurrency string `json:"list_currency,omitempty"` ListRate string `json:"list_rate,omitempty"` Mode string `json:"mode,omitempty"` Object string `json:"object,omitempty"` Rate string `json:"rate,omitempty"` RetailCurrency string `json:"retail_currency,omitempty"` RetailRate string `json:"retail_rate,omitempty"` Service string `json:"service,omitempty"` ShipmentID string `json:"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"` TaxIdType string `json:"tax_id_type,omitempty"` TaxId string `json:"tax_id,omitempty"` IssuingCountry string `json:"issuing_country,omitempty"` }
TaxIdentifier objects contain tax information used by carriers.
type TimeInTransit ¶
type TimeInTransit struct { Percentile50 int `json:"percentile_50,omitempty"` Percentile75 int `json:"percentile_75,omitempty"` Percentile85 int `json:"percentile_85,omitempty"` Percentile90 int `json:"percentile_90,omitempty"` Percentile95 int `json:"percentile_95,omitempty"` Percentile97 int `json:"percentile_97,omitempty"` Percentile99 int `json:"percentile_99,omitempty"` }
TimeInTransit provides details on the probability your package will arrive within a certain number of days
type TimeoutError ¶
type TimeoutError struct {
APIError
}
TimeoutError is raised when the API returns a 408 status code.
type Tracker ¶
type Tracker struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` CreatedAt *DateTime `json:"created_at,omitempty"` UpdatedAt *DateTime `json:"updated_at,omitempty"` TrackingCode string `json:"tracking_code,omitempty"` Status string `json:"status,omitempty"` StatusDetail string `json:"status_detail,omitempty"` SignedBy string `json:"signed_by,omitempty"` Weight float64 `json:"weight,omitempty"` EstDeliveryDate *DateTime `json:"est_delivery_date,omitempty"` ShipmentID string `json:"shipment_id,omitempty"` Carrier string `json:"carrier,omitempty"` TrackingDetails []*TrackingDetail `json:"tracking_details,omitempty"` CarrierDetail *TrackingCarrierDetail `json:"carrier_detail,omitempty"` PublicURL string `json:"public_url,omitempty"` Fees []*Fee `json:"fees,omitempty"` Finalized bool `json:"finalized,omitempty"` IsReturn bool `json:"is_return,omitempty"` }
A Tracker object contains all the tracking information for a package.
type TrackingCarrierDetail ¶
type TrackingCarrierDetail struct { Object string `json:"object,omitempty"` Service string `json:"service,omitempty"` ContainerType string `json:"container_type,omitempty"` EstDeliveryDateLocal string `json:"est_delivery_date_local,omitempty"` EstDeliveryTimeLocal string `json:"est_delivery_time_local,omitempty"` OriginLocation string `json:"origin_location,omitempty"` OriginTrackingLocation *TrackingLocation `json:"origin_tracking_location,omitempty"` DestinationLocation string `json:"destination_location,omitempty"` DestinationTrackingLocation *TrackingLocation `json:"destination_tracking_location,omitempty"` GuaranteedDeliveryDate *DateTime `json:"guaranteed_delivery_date,omitempty"` AlternateIdentifier string `json:"alternate_identifier,omitempty"` InitialDeliveryAttempt *DateTime `json:"initial_delivery_attempt,omitempty"` }
TrackingCarrierDetail provides additional tracking information from the carrier, when available.
type TrackingDetail ¶
type TrackingDetail struct { Object string `json:"object,omitempty"` Message string `json:"message,omitempty"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` StatusDetail string `json:"status_detail,omitempty"` DateTime string `json:"datetime,omitempty"` Source string `json:"source,omitempty"` CarrierCode string `json:"carrier_code,omitempty"` TrackingLocation *TrackingLocation `json:"tracking_location,omitempty"` }
TrackingDetail provides information about a tracking event.
type TrackingLocation ¶
type TrackingLocation struct { Object string `json:"object,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Country string `json:"country,omitempty"` Zip string `json:"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.
type UnknownHttpError ¶
type UnknownHttpError struct {
APIError
}
UnknownHttpError is raised when the API returns an unrecognized status code.
type User ¶
type User struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` ParentID string `json:"parent_id,omitempty"` Name string `json:"name,omitempty"` Email string `json:"email,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` Balance string `json:"balance,omitempty"` RechargeAmount string `json:"recharge_amount,omitempty"` SecondaryRechargeAmount string `json:"secondary_recharge_amount,omitempty"` RechargeThreshold string `json:"recharge_threshold,omitempty"` Children []*User `json:"children,omitempty"` APIKeys []*APIKey `json:"api_keys,omitempty"` }
A User contains data about an EasyPost account and child accounts.
type UserOptions ¶
type UserOptions struct { ID string `json:"-"` Email *string `json:"email,omitempty"` Password *string `json:"password,omitempty"` PasswordConfirmation *string `json:"password_confirmation,omitempty"` CurrentPassword *string `json:"current_password,omitempty"` Name *string `json:"name,omitempty"` Phone *string `json:"phone,omitempty"` PhoneNumber *string `json:"phone_number,omitempty"` RechargeAmount *string `json:"recharge_amount,omitempty"` SecondaryRechargeAmount *string `json:"secondary_recharge_amount,omitempty"` RechargeThreshold *string `json:"recharge_threshold,omitempty"` }
UserOptions specifies options for creating or updating a user.
type Webhook ¶
type Webhook struct { ID string `json:"id,omitempty"` Object string `json:"object,omitempty"` Mode string `json:"mode,omitempty"` URL string `json:"url,omitempty"` DisabledAt *DateTime `json:"disabled_at,omitempty"` WebhookSecret string `json:"webhook_secret,omitempty"` }
A Webhook represents an EasyPost webhook callback URL.
Source Files ¶
- address.go
- api_key.go
- batch.go
- billing.go
- brand.go
- carbon_offset.go
- carrier.go
- carrier_message.go
- carrier_metadata.go
- client.go
- constants.go
- customs.go
- datetime.go
- endshipper.go
- error.go
- event.go
- fee.go
- hooks.go
- insurance.go
- list_options.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
- tax_identifier.go
- tracker.go
- user.go
- util.go
- version.go
- webhook.go