Documentation ¶
Index ¶
- type Client
- func (c *Client) AddBatchShipmentsToBatch(objectID string, batchShipments []*models.BatchShipmentInput) (*models.Batch, error)
- func (c *Client) CreateAddress(input *models.AddressInput) (*models.Address, error)
- func (c *Client) CreateCarrierAccount(input *models.CarrierAccountInput) (*models.CarrierAccount, error)
- func (c *Client) CreateCustomsDeclaration(input *models.CustomsDeclarationInput) (*models.CustomsDeclaration, error)
- func (c *Client) CreateCustomsItem(input *models.CustomsItemInput) (*models.CustomsItem, error)
- func (c *Client) CreateManifest(input *models.ManifestInput) (*models.Manifest, error)
- func (c *Client) CreateParcel(input *models.ParcelInput) (*models.Parcel, error)
- func (c *Client) CreateRefund(input *models.RefundInput) (*models.Refund, error)
- func (c *Client) CreateShipment(input *models.ShipmentInput) (*models.Shipment, error)
- func (c *Client) GetShippingRates(shipmentObjectID, currencyCode string) ([]*models.Rate, error)
- func (c *Client) GetTrackingUpdate(carrier, trackingNumber string) (*models.TrackingStatus, error)
- func (c *Client) ListAllAddresses() ([]*models.Address, error)
- func (c *Client) ListAllCarrierAccounts() ([]*models.CarrierAccount, error)
- func (c *Client) ListAllCustomsDeclaration() ([]*models.CustomsDeclaration, error)
- func (c *Client) ListAllCustomsItems() ([]*models.CustomsItem, error)
- func (c *Client) ListAllManifests() ([]*models.Manifest, error)
- func (c *Client) ListAllParcels() ([]*models.Parcel, error)
- func (c *Client) ListAllRefunds() ([]*models.Refund, error)
- func (c *Client) ListAllShipments() ([]*models.Shipment, error)
- func (c *Client) ListAllTransactions() ([]*models.Transaction, error)
- func (c *Client) PurchaseBatch(objectID string) (*models.Batch, error)
- func (c *Client) PurchaseShippingLabel(input *models.TransactionInput) (*models.Transaction, error)
- func (c *Client) RegisterTrackingWebhook(carrier, trackingNumber, metadata string) (*models.TrackingStatus, error)
- func (c *Client) RemoveBatchShipmentsFromBatch(objectID string, batchShipmentIDs []string) (*models.Batch, error)
- func (c *Client) RetrieveAddress(objectID string) (*models.Address, error)
- func (c *Client) RetrieveBatch(objectID string, page uint, objectResultsFilter string) (*models.Batch, error)
- func (c *Client) RetrieveCarrierAccount(objectID string) (*models.CarrierAccount, error)
- func (c *Client) RetrieveCustomsDeclaration(objectID string) (*models.CustomsDeclaration, error)
- func (c *Client) RetrieveCustomsItem(objectID string) (*models.CustomsItem, error)
- func (c *Client) RetrieveManifest(objectID string) (*models.Manifest, error)
- func (c *Client) RetrieveParcel(objectID string) (*models.Parcel, error)
- func (c *Client) RetrieveRate(objectID string) (*models.Rate, error)
- func (c *Client) RetrieveRefund(objectID string) (*models.Refund, error)
- func (c *Client) RetrieveShipment(objectID string) (*models.Shipment, error)
- func (c *Client) RetrieveTransaction(objectID string) (*models.Transaction, error)
- func (c *Client) SetTraceLogger(logger *log.Logger) *log.Logger
- func (c *Client) UpdateCarrierAccount(objectID string, input *models.CarrierAccountInput) (*models.CarrierAccount, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddBatchShipmentsToBatch ¶
func (c *Client) AddBatchShipmentsToBatch(objectID string, batchShipments []*models.BatchShipmentInput) (*models.Batch, error)
AddBatchShipmentsToBatch adds batch shipment(s) to an existing Batch.
func (*Client) CreateAddress ¶
CreateAddress creates a new address object.
func (*Client) CreateCarrierAccount ¶
func (c *Client) CreateCarrierAccount(input *models.CarrierAccountInput) (*models.CarrierAccount, error)
CreateCarrierAccount creates a new carrier account object.
func (*Client) CreateCustomsDeclaration ¶
func (c *Client) CreateCustomsDeclaration(input *models.CustomsDeclarationInput) (*models.CustomsDeclaration, error)
CreateCustomsDeclaration creates a new customs declaration object.
func (*Client) CreateCustomsItem ¶
func (c *Client) CreateCustomsItem(input *models.CustomsItemInput) (*models.CustomsItem, error)
CreateCustomsItem creates a new customs item object.
func (*Client) CreateManifest ¶
CreateManifest creates a new manifest object.
func (*Client) CreateParcel ¶
CreateParcel creates a new parcel object.
func (*Client) CreateRefund ¶
CreateRefund creates a new refund object.
func (*Client) CreateShipment ¶
CreateShipment creates a new shipment object. To create a return label, simply pass the ObjectID of the original outbound Transaction to the ReturnOf field. If this flag is set, purchasing the generated rates will create a Scan-based return label. The advantage of using a Scan-based label is that you will only be charged if the label is used/scanned (not when the label is created). The Shippo API currently supports Scan-based returns for USPS, Fedex and UPS. When the ReturnOf flag is set, Shippo API will automatically swap the address_from and address_to fields for label creation. Please check the return service terms and condition for the carrier you intend to use.
func (*Client) GetShippingRates ¶
GetShippingRates gets rates for a shipping object.
func (*Client) GetTrackingUpdate ¶
func (c *Client) GetTrackingUpdate(carrier, trackingNumber string) (*models.TrackingStatus, error)
GetTrackingUpdate requests the tracking status of a shipment.
func (*Client) ListAllAddresses ¶
ListAllAddresses lists all addresses.
func (*Client) ListAllCarrierAccounts ¶
func (c *Client) ListAllCarrierAccounts() ([]*models.CarrierAccount, error)
ListAllCarrierAccounts lists all carrier accounts.
func (*Client) ListAllCustomsDeclaration ¶
func (c *Client) ListAllCustomsDeclaration() ([]*models.CustomsDeclaration, error)
ListAllCustomsDeclaration lists all customs declaration objects.
func (*Client) ListAllCustomsItems ¶
func (c *Client) ListAllCustomsItems() ([]*models.CustomsItem, error)
ListAllCustomsItems lists all customs item objects.
func (*Client) ListAllManifests ¶
ListAllManifests lists all manifest objects.
func (*Client) ListAllParcels ¶
ListAllParcels lists all parcel objects.
func (*Client) ListAllRefunds ¶
ListAllRefunds list all refund objects.
func (*Client) ListAllShipments ¶
ListAllShipments lists all shipment objects.
func (*Client) ListAllTransactions ¶
func (c *Client) ListAllTransactions() ([]*models.Transaction, error)
ListAllTransactions lists all transaction objects.
func (*Client) PurchaseBatch ¶
PurchaseBatch purchases an existing batch with an ObjectStatus of "VALID". Once you send invoke this function, the batch ObjectStatus will be change to PURCHASING. When all the shipments are purchased, the ObjectStatus will change to PURCHASED and you will receive a batch_purchased webhook indicating that the batch has been purchased.
func (*Client) PurchaseShippingLabel ¶
func (c *Client) PurchaseShippingLabel(input *models.TransactionInput) (*models.Transaction, error)
PurchaseShippingLabel creates a new transaction object and purchases the shipping label for the provided rate.
func (*Client) RegisterTrackingWebhook ¶
func (c *Client) RegisterTrackingWebhook(carrier, trackingNumber, metadata string) (*models.TrackingStatus, error)
RegisterTrackingWebhook registers a tracking webhook. TODO: documentation on this API endpoint is not clear. https://goshippo.com/docs/reference#tracks-create
func (*Client) RemoveBatchShipmentsFromBatch ¶
func (c *Client) RemoveBatchShipmentsFromBatch(objectID string, batchShipmentIDs []string) (*models.Batch, error)
RemoveBatchShipmentsFromBatch removes batch shipment(s) from an existing Batch.
func (*Client) RetrieveAddress ¶
RetrieveAddress retrieves an existing address by object id.
func (*Client) RetrieveBatch ¶
func (c *Client) RetrieveBatch(objectID string, page uint, objectResultsFilter string) (*models.Batch, error)
RetrieveBatch retrieves an existing batch. BatchShipments are displayed 100 at a time. You can iterate through each "page" by specifying non-zero value to page parameter. You can also filter based on BatchShipment status using objectResultsFilter parameter
func (*Client) RetrieveCarrierAccount ¶
func (c *Client) RetrieveCarrierAccount(objectID string) (*models.CarrierAccount, error)
RetrieveCarrierAccount retrieves an existing carrier account by object id.
func (*Client) RetrieveCustomsDeclaration ¶
func (c *Client) RetrieveCustomsDeclaration(objectID string) (*models.CustomsDeclaration, error)
RetrieveCustomsDeclaration retrieves an existing customs declaration by object id.
func (*Client) RetrieveCustomsItem ¶
func (c *Client) RetrieveCustomsItem(objectID string) (*models.CustomsItem, error)
RetrieveCustomsItem retrieves an existing customs item by object id.
func (*Client) RetrieveManifest ¶
RetrieveManifest retrieves an existing manifest by object id.
func (*Client) RetrieveParcel ¶
RetrieveParcel retrieves an existing parcel by object id.
func (*Client) RetrieveRate ¶
RetrieveRate retrieves an existing rate by object id.
func (*Client) RetrieveRefund ¶
RetrieveRefund retrieves an existing refund by object id.
func (*Client) RetrieveShipment ¶
RetrieveShipment retrieves an existing shipment by object id.
func (*Client) RetrieveTransaction ¶
func (c *Client) RetrieveTransaction(objectID string) (*models.Transaction, error)
RetrieveTransaction retrieves an existing transaction by object id.
func (*Client) SetTraceLogger ¶
SetTraceLogger sets a new trace logger and returns the old logger. If logger is not nil, Client will output all internal messages to the logger.
func (*Client) UpdateCarrierAccount ¶
func (c *Client) UpdateCarrierAccount(objectID string, input *models.CarrierAccountInput) (*models.CarrierAccount, error)
UpdateCarrierAccount updates an existing carrier account. AccountID and Carrier cannot be updated because they form the unique identifier together.