Documentation
¶
Index ¶
- Constants
- type Address
- type AddressInput
- type Authentication
- type Batch
- type BatchInput
- type BatchObjectResults
- type BatchShipment
- type BatchShipmentInput
- type BatchShipmentList
- type BiologicalMaterial
- type CarrierAccount
- type CarrierAccountInput
- type CommonOutputFields
- type ConnectOauth
- type CustomsDeclaration
- type CustomsDeclarationInput
- type CustomsItem
- type CustomsItemInput
- type DangerousGoods
- type LineItem
- type ListAPIOutput
- type LithiumBatteries
- type Manifest
- type ManifestInput
- type ObjectInfo
- type Order
- type OrderInput
- type OutputMessage
- type Parcel
- type ParcelCOD
- type ParcelExtra
- type ParcelInput
- type ParcelInsurance
- type Rate
- type Refund
- type RefundInput
- type ServiceLevel
- type Shipment
- type ShipmentBilling
- type ShipmentCOD
- type ShipmentExtra
- type ShipmentInput
- type ShipmentInsurance
- type TrackingStatus
- type TrackingStatusDict
- type TrackingStatusInput
- type TrackingStatusLocation
- type Transaction
- type TransactionInput
- type ValidationResults
Constants ¶
View Source
const ( AddressObjectSourceFullyEntered = "FULLY_ENTERED" AddressObjectSourcePartiallyEntered = "PARTIALLY_ENTERED" AddressObjectSourceValidator = "VALIDATOR" )
View Source
const ( CarrierAustraliaPost = "australia_post" CarrierCanadaPost = "canada_post" CarrierDeutschePost = "deutsche_post" CarrierDHLGermany = "dhl_germany" CarrierDHLeCommerce = "dhl_ecommerce" CarrierDHLExpress = "dhl_express" CarrierFedEx = "fedex" CarrierGLSGermany = "gls_de" CarrierGLSFrance = "gls_fr" CarrierLasership = "lasership" CarrierMondialRelay = "mondial_relay" CarrierNewgistics = "newgistics" CarrierOnTrac = "ontrac" CarrierPurolator = "purolator" CarrierUPS = "ups" CarrierUSPS = "usps" ObjectStateValid = "VALID" ObjectStateInvalid = "INVALID" StatusWaiting = "WAITING" StatusQueued = "QUEUED" StatusSuccess = "SUCCESS" StatusError = "ERROR" StatusRefunded = "REFUNDED" StatusRefundPending = "REFUNDPENDING" StatusRefundRejected = "REFUNDREJECTED" StatusPending = "PENDING" StatusValidating = "VALIDATING" StatusValid = "VALID" StatusInvalid = "INVALID" StatusPurchasing = "PURCHASING" StatusPurchased = "PURCHASED" StatusIncomplete = "INCOMPLETE" StatusTransactionFailed = "TRANSACTION_FAILED" InsuranceProviderFedEx = "FEDEX" InsuranceProviderUPS = "UPS" InsuranceProviderOnTrac = "ONTRAC" CODPaymentMethodSecuredFunds = "SECURED_FUNDS" CODPaymentMethodCash = "CASH" CODPaymentMethodAny = "ANY" DistanceUnitCentiMeter = "cm" DistanceUnitInch = "in" DistanceUnitFoot = "ft" DistanceUnitMilliMeter = "mm" DistanceUnitMeter = "m" DistanceUnitYard = "yd" MassUnitGram = "g" MassUnitOunce = "oz" MassUnitPound = "lb" MassUnitKiloGram = "kg" LabelFileTypePNG = "PNG" LabelFileTypePDF = "PDF" LabelFileTypePDF4X6 = "PDF_4X6" LabelFileTypeZPLII = "ZPLII" )
View Source
const ( CustomsNonDeliveryOptionAbandon = "ABANDON" CustomsNonDeliveryOptionReturn = "RETURN" CustomsContentsTypeDocuments = "DOCUMENTS" CustomsContentsTypeGift = "GIFT" CustomsContentsTypeSample = "SAMPLE" CustomsContentsTypeHumanitarianDonation = "HUMANITARIAN_DONATION" CustomsContentsTypeReturnMerchandise = "RETURN_MERCHANDISE" CustomsContentsTypeOther = "OTHER" CustomsEEL_PFC_NOEEI_30_37_A = "NOEEI_30_37_a" CustomsEEL_PFC_NOEEI_30_37_H = "NOEEI_30_37_h" CustomsEEL_PFC_NOEEI_30_37_F = "NOEEI_30_37_f" CustomsEEL_PFC_NOEEI_30_36 = "NOEEI_30_36" CustomsEEL_PFC_AES_ITN = "AES_ITN" CustomsIncotermDDP = "DDP" CustomsIncotermDDU = "DDU" CustomsIncotermCPT = "CPT" CustomsIncotermCIP = "CIP" )
View Source
const ( ShipmentExtraSignatureConfirmationStandard = "STANDARD" ShipmentExtraSignatureConfirmationAdult = "ADULT" ShipmentExtraSignatureConfirmationCertified = "CERTIFIED" ShipmentBillingTypeSender = "SENDER" ShipmentBillingTypeRecipient = "RECIPIENT" ShipmentBillingTypeThirdParty = "THIRD_PARTY" ShipmentUSPSSortTypeNDC = "NDC" ShipmentUSPSSortTypeFiveDigit = "FiveDigit" ShipmentUSPSSortTypeMixedNDC = "MixedNDC" ShipmentUSPSSortTypeNonPresorted = "Nonpresorted" ShipmentUSPSSortTypePresorted = "Presorted" ShipmentUSPSSortTypeSCF = "SCF" ShipmentUSPSSortTypeSinglePiece = "SinglePiece" ShipmentUSPSSortTypeThreeDigit = "ThreeDigit" ShipmentUSPSEntryFacilityDNDC = "DNDC" ShipmentUSPSEntryFacilityDDU = "DDU" ShipmentUSPSEntryFacilityDSCF = "DSCF" ShipmentUSPSEntryFacilityONDC = "ONDC" ShipmentUSPSEntryFacilityOther = "Other" ShipmentDangerousGoodsCode01 = "01" ShipmentDangerousGoodsCode02 = "02" ShipmentDangerousGoodsCode03 = "03" ShipmentDangerousGoodsCode04 = "04" ShipmentDangerousGoodsCode05 = "05" ShipmentDangerousGoodsCode06 = "06" ShipmentDangerousGoodsCode07 = "07" ShipmentDangerousGoodsCode08 = "08" ShipmentDangerousGoodsCode09 = "019" )
View Source
const ( TrackingStatusStatusUnknown = "UNKNOWN" TrackingStatusStatusDelivered = "DELIVERED" TrackingStatusStatusTransit = "TRANSIT" TrackingStatusStatusFailure = "FAILURE" TrackingStatusStatusReturned = "RETURNED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
AddressInput
CommonOutputFields
IsComplete bool `json:"is_complete"`
Test bool `json:"test"`
ValidationResults *ValidationResults `json:"validation_results"`
}
type AddressInput ¶
type AddressInput struct {
Name string `json:"name,omitempty"`
Company string `json:"company,omitempty"`
Street1 string `json:"street1,omitempty"`
StreetNo string `json:"street_no,omitempty"`
Street2 string `json:"street2,omitempty"`
Street3 string `json:"street3,omitempty"`
City string `json:"city,omitempty"`
Zip string `json:"zip,omitempty"`
State string `json:"state,omtiempty"`
Country string `json:"country,omitempty"`
Phone string `json:"phone,omitempty"`
Email string `json:"email,omitempty"`
IsResidential bool `json:"is_residential"`
Validate bool `json:"validate"`
Metadata string `json:"metadata,omitempty"`
}
type Authentication ¶
type Batch ¶
type Batch struct {
//BatchInput // seems that output format is slightly different
CommonOutputFields
Status string `json:"status,omitempty"`
DefaultCarrierAccount string `json:"default_carrier_account,omitempty"`
DefaultServiceLevelToken string `json:"default_servicelevel_token,omitempty"`
LabelFileType string `json:"label_filetype,omitempty"`
Metadata string `json:"metadata,omitempty"`
BatchShipments *BatchShipmentList `json:"batch_shipments"`
LabelURL []string `json:"label_url"`
ObjectResults *BatchObjectResults `json:"object_results"`
}
type BatchInput ¶
type BatchInput struct {
DefaultCarrierAccount string `json:"default_carrier_account,omitempty"`
DefaultServiceLevelToken string `json:"default_servicelevel_token,omitempty"`
LabelFileType string `json:"label_filetype,omitempty"`
Metadata string `json:"metadata,omitempty"`
BatchShipments []*BatchShipmentInput `json:"batch_shipments"`
}
type BatchObjectResults ¶
type BatchShipment ¶
type BatchShipment struct {
BatchShipmentInput
CommonOutputFields
Transaction string `json:"transaction"`
Messages []json.RawMessage `json:"messages"` // cannot find format in documentation
}
See https://goshippo.com/docs/reference#batches-batchshipments
type BatchShipmentInput ¶
type BatchShipmentInput struct {
CarrierAccount string `json:"carrier_account,omitempty"`
ServiceLevelToken string `json:"servicelevel_token,omitempty"`
Shipment string `json:"shipment"`
Metadata string `json:"metadata,omitempty"`
}
See https://goshippo.com/docs/reference#batches-batchshipments
type BatchShipmentList ¶
type BatchShipmentList struct {
Count int `json:"count"`
Next string `json:"next,omitempty"`
Previous string `json:"previous,omitempty"`
Results []*BatchShipment `json:"results"`
}
type BiologicalMaterial ¶ added in v1.6.4
type BiologicalMaterial struct {
Contains bool `json:"contains"`
}
type CarrierAccount ¶
type CarrierAccount struct {
CarrierAccountInput
CommonOutputFields
Test bool `json:"test"`
ObjectInfo *ObjectInfo `json:"object_info"`
}
type CarrierAccountInput ¶
type CommonOutputFields ¶
type ConnectOauth ¶
type ConnectOauth struct {
RedirectUri string `json:"redirect_uri"`
}
type CustomsDeclaration ¶
type CustomsDeclaration struct {
CustomsDeclarationInput
CommonOutputFields
ObjectState string `json:"object_state,omitempty"`
Test bool `json:"test"`
}
type CustomsDeclarationInput ¶
type CustomsDeclarationInput struct {
CertifySigner string `json:"certify_signer"`
Certify bool `json:"certify"`
Items interface{} `json:"items"` // []string or []*CustomsItemInput
NonDeliveryOption string `json:"non_delivery_option"`
ContentsType string `json:"contents_type"`
ContentsExplanation string `json:"contents_explanation,omitempty"`
ExporterReference string `json:"exporter_reference,omitempty"`
Invoice string `json:"invoice,omitempty"`
License string `json:"license,omitempty"`
Certificate string `json:"certificate,omitempty"`
Notes string `json:"notes,omitempty"`
EEL_PFC string `json:"eel_pfc,omitempty"`
AES_ITN string `json:"aes_itn,omitempty"`
Incoterm string `json:"incoterm,omitempty"`
Metadata string `json:"metadata,omitempty"`
Disclaimer string `json:"disclaimer,omitempty"`
// contains filtered or unexported fields
}
type CustomsItem ¶
type CustomsItem struct {
CustomsItemInput
CommonOutputFields
ObjectState string `json:"object_state,omitempty"`
Test bool `json:"test"`
}
type CustomsItemInput ¶
type CustomsItemInput struct {
Description string `json:"description"`
Quantity int `json:"quantity"`
NetWeight string `json:"net_weight"`
MassUnit string `json:"mass_unit"`
ValueAmount string `json:"value_amount"`
ValueCurrency string `json:"value_currency"`
OriginCountry string `json:"origin_country"`
TariffNumber string `json:"tariff_number,omitempty"`
Metadata string `json:"metadata,omitempty"`
}
type DangerousGoods ¶ added in v1.6.4
type DangerousGoods struct {
Contains bool `json:"contains"`
BiologicalMaterial *BiologicalMaterial `json:"biological_material,omitempty"`
LithiumBatteries *LithiumBatteries `json:"lithium_batteries,omitempty"`
}
type LineItem ¶
type LineItem struct {
Currency string `json:"currency,omitempty"`
ManufactureCountry string `json:"manufacture_country,omitempty"`
MaxDeliveryTime time.Time `json:"max_delivery_time,omitempty"`
MaxShipTime time.Time `json:"max_ship_time,omitempty"`
Quantity int `json:"quantity,omitempty"`
Sku string `json:"sku,omitempty"`
Title string `json:"title,omitempty"`
TotalPrice string `json:"total_price,omitempty"`
VariantTitle string `json:"variant_title,omitempty"`
Weight string `json:"weight,omitempty"`
WeightUnit string `json:"weight_unit,omitempty"`
ObjectID string `json:"object_id,omitempty"`
}
type ListAPIOutput ¶
type ListAPIOutput struct {
NextPageURL *string `json:"next"`
PreviousPageURL *string `json:"previous"`
Results []json.RawMessage `json:"results"`
}
type LithiumBatteries ¶ added in v1.6.4
type LithiumBatteries struct {
Contains bool `json:"contains"`
}
type Manifest ¶
type Manifest struct {
ManifestInput
CommonOutputFields
State string `json:"state,omitempty"`
}
type ManifestInput ¶
type ManifestInput struct {
CarrierAccount string `json:"carrier_account,omitempty"`
ShipmentDate time.Time `json:"shipment_date,omitempty"`
AddressFrom string `json:"address_from,omitempty"`
Transactions []string `json:"transactions,omitempty"`
Documents []string `json:"documents,omitempty"`
Async bool `json:"async"`
}
type ObjectInfo ¶
type ObjectInfo struct {
Authentication *Authentication `json:"authentication"`
}
type Order ¶
type Order struct {
CommonOutputFields
Currency string `json:"currency,omitempty"`
Notes string `json:"notes,omitempty"`
OrderNumber string `json:"order_number,omitempty"`
OrderStatus string `json:"order_status,omitempty"`
PlacedAt time.Time `json:"placed_at,omitempty"`
ShippingCost string `json:"shipping_cost,omitempty"`
ShippingCostCurrency string `json:"shipping_cost_currency,omitempty"`
ShippingMethod string `json:"shipping_method,omitempty"`
SubtotalPrice string `json:"subtotal_price,omitempty"`
TotalPrice string `json:"total_price,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Weight string `json:"weight,omitempty"`
WeightUnit string `json:"weight_unit,omitempty"`
FromAddress Address `json:"from_address,omitempty"`
ToAddress Address `json:"to_address,omitempty"`
LineItems []LineItem `json:"line_items,omitempty"`
ShopApp string `json:"shop_app,omitempty"`
Transactions []string `json:"transactions,omitempty"`
}
type OrderInput ¶
type OrderInput struct {
Currency string `json:"currency,omitempty"`
Notes string `json:"notes,omitempty"`
OrderNumber string `json:"order_number,omitempty"`
OrderStatus string `json:"order_status,omitempty"`
PlacedAt time.Time `json:"placed_at,omitempty"`
ShippingCost string `json:"shipping_cost,omitempty"`
ShippingCostCurrency string `json:"shipping_cost_currency,omitempty"`
ShippingMethod string `json:"shipping_method,omitempty"`
SubtotalPrice string `json:"subtotal_price,omitempty"`
TotalPrice string `json:"total_price,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Weight string `json:"weight,omitempty"`
WeightUnit string `json:"weight_unit,omitempty"`
FromAddress AddressInput `json:"from_address,omitempty"`
ToAddress AddressInput `json:"to_address,omitempty"`
LineItems []LineItem `json:"line_items,omitempty"`
}
See https://docs.goshippo.com/shippoapi/public-api/#tag/Orders
type OutputMessage ¶
type Parcel ¶
type Parcel struct {
ParcelInput
CommonOutputFields
ObjectState string `json:"object_state,omitempty"`
Test bool `json:"test"`
}
type ParcelExtra ¶
type ParcelExtra struct {
COD *ParcelCOD `json:"COD,omitempty"`
Insurance *ParcelInsurance `json:"insurance,omitempty"`
Reference1 string `json:"reference_1,omitempty"`
Reference2 string `json:"reference_2,omitempty"`
}
type ParcelInput ¶
type ParcelInput struct {
Length string `json:"length"`
Width string `json:"width"`
Height string `json:"height"`
DistanceUnit string `json:"distance_unit"`
Weight string `json:"weight"`
MassUnit string `json:"mass_unit"`
Template string `json:"template,omitempty"` // https://goshippo.com/docs/reference#parceltemplates
Extra *ParcelExtra `json:"extra,omitempty"`
Metadata string `json:"metadata,omitempty"`
}
type ParcelInsurance ¶
type Rate ¶
type Rate struct {
CommonOutputFields
Attributes []string `json:"attributes"`
AmountLocal string `json:"amount_local"`
CurrencyLocal string `json:"currency_local"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Provider string `json:"provider"`
ProviderImage75 string `json:"provider_image_75"`
ProviderImage200 string `json:"provider_image_200"`
ServiceLevel *ServiceLevel `json:"servicelevel"`
EstimatedDays int `json:"estimated_days"`
ArrivesBy string `json:"arrives_by"`
DurationTerms string `json:"duration_terms"`
CarrierAccount string `json:"carrier_account"`
Zone string `json:"zone"`
Messages []*OutputMessage `json:"messages"`
Test bool `json:"test"`
}
type Refund ¶
type Refund struct {
RefundInput
CommonOutputFields
Status string `json:"status,omitempty"`
Test bool `json:"test"`
}
type RefundInput ¶
type ServiceLevel ¶
type ServiceLevel struct {
Name string `json:"name"`
Token string `json:"token"` // https://goshippo.com/docs/reference#servicelevels
Terms string `json:"terms"`
}
type Shipment ¶
type Shipment struct {
CommonOutputFields
Status string `json:"status,omitempty"`
AddressFrom *Address `json:"address_from,omitempty"`
AddressTo *Address `json:"address_to,omitempty"`
Parcels []*Parcel `json:"parcels,omitempty"`
AddressReturn *Address `json:"address_return,omitempty"`
CustomsDeclaration *CustomsDeclaration `json:"customs_declaration,omitempty"`
Rates []*Rate `json:"rates,omitempty"`
Messages []*OutputMessage `json:"messages,omitempty"`
Test bool `json:"test,omitempty"`
}
type ShipmentBilling ¶
type ShipmentCOD ¶
type ShipmentExtra ¶
type ShipmentExtra struct {
SignatureConfirmation string `json:"signature_confirmation,omitempty"`
SaturdayDelivery bool `json:"saturday_delivery"`
BypassAddressValidation bool `json:"bypass_address_validation"`
RequestRetailRates bool `json:"request_retail_rates"`
CustomerBranch string `json:"customer_branch,omitempty"`
Billing *ShipmentBilling `json:"billing,omitempty"`
COD *ShipmentCOD `json:"COD,omitempty"`
Insurance *ShipmentInsurance `json:"insurance,omitempty"`
USPSSortType string `json:"usps_sort_type,omitempty"`
USPSEntryFacility string `json:"usps_entry_facility,omitempty"`
DangerousGoodsCode string `json:"dangerous_goods_code,omitempty"`
DangerousGoods *DangerousGoods `json:"dangerous_goods,omitempty"`
IsReturn bool `json:"is_return,omitempty"`
Reference1 string `json:"reference_1,omitempty"`
Reference2 string `json:"reference_2,omitempty"`
}
type ShipmentInput ¶
type ShipmentInput struct {
AddressFrom interface{} `json:"address_from"` // string or *AddressInput
AddressTo interface{} `json:"address_to"` // string or *AddressInput
Parcels interface{} `json:"parcels"` // string, []string, *ParcelInput, or []*ParcelInput
AddressReturn interface{} `json:"address_return,omitempty"` // string or *AddressInput
CustomsDeclaration interface{} `json:"customs_declaration,omitempty"` // string or *CustomsDeclarationInput
ShipmentDate time.Time `json:"shipment_date,omitempty"`
CarrierAccounts []string `json:"carrier_accounts,omitempty"`
Metadata string `json:"metadata,omitempty"`
Extra *ShipmentExtra `json:"extra,omitempty"`
Async bool `json:"async"`
Order string `json:"order,omitempty"`
}
type ShipmentInsurance ¶
type TrackingStatus ¶
type TrackingStatus struct {
TrackingStatusInput
AddressFrom *TrackingStatusLocation `json:"address_from,omitempty"`
AddressTo *TrackingStatusLocation `json:"address_to,omitempty"`
ETA time.Time `json:"eta"`
OriginalETA time.Time `json:"original_eta"`
ServiceLevel *ServiceLevel `json:"servicelevel,omitempty"`
TrackingStatus *TrackingStatusDict `json:"tracking_status,omitempty"`
TrackingHistory []*TrackingStatusDict `json:"tracking_history,omitempty"`
Messages []*OutputMessage `json:"messages,omitempty"`
Transaction string `json:"transaction,omitempty"`
Test bool `json:"test"`
}
type TrackingStatusDict ¶
type TrackingStatusDict struct {
CommonOutputFields
Status string `json:"status,omitempty"`
StatusDetails string `json:"status_details,omitempty"`
StatusDate time.Time `json:"status_date,omitempty"`
Location *TrackingStatusLocation `json:"location,omitempty"`
Substatus struct {
Code string `json:"code"`
Text string `json:"text"`
ActionRequired bool `json:"action_required"`
} `json:"substatus"`
}
type TrackingStatusInput ¶
type TrackingStatusLocation ¶
type Transaction ¶
type Transaction struct {
TransactionInput
CommonOutputFields
ObjectState string `json:"object_state,omitempty"`
Status string `json:"status,omitempty"`
Test bool `json:"test"`
TrackingNumber string `json:"tracking_number,omitempty"`
TrackingStatus string `json:"tracking_status,omitempty"`
TrackingURLProvider string `json:"tracking_url_provider,omitempty"`
Eta time.Time `json:"eta,omitempty"`
LabelURL string `json:"label_url,omitempty"`
CommercialInvoiceURL string `json:"commercial_invoice_url,omitempty"`
Messages []*OutputMessage `json:"messages,omitempty"`
QRCodeURL string `json:"qr_code_url,omitempty"`
Async bool `json:"async"`
Order string `json:"order,omitempty"`
}
type TransactionInput ¶
type TransactionInput struct {
Rate interface{} `json:"rate,omitempty"`
Metadata string `json:"metadata,omitempty"`
LabelFileType string `json:"label_file_type"`
Async bool `json:"async"`
Shipment *ShipmentInput `json:"shipment,omitempty"` // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
CarrierAccount string `json:"carrier_account,omitempty"` // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
ServiceLevelToken string `json:"servicelevel_token,omitempty"` // instant call only: https://goshippo.com/docs/reference#transactions-create-instant
Order string `json:"order,omitempty"`
}
type ValidationResults ¶
type ValidationResults struct {
IsValid bool `json:"is_valid"`
Messages []*OutputMessage `json:"messages"`
}
Click to show internal directories.
Click to hide internal directories.