Documentation ¶
Index ¶
- Constants
- Variables
- type APIContext
- func (c *APIContext) CreateAddress(ctx context.Context, v *Address) (resp *Address, err error)
- func (c *APIContext) CreateCSVProfile(ctx context.Context, v *CSVProfile) (resp *CSVProfile, err error)
- func (c *APIContext) CreateCarrier(ctx context.Context, v *Carrier) (resp *Carrier, err error)
- func (c *APIContext) CreateDHLProduct(ctx context.Context, v *Product) (resp *Product, err error)
- func (c *APIContext) CreateJob(ctx context.Context, v *ShipmentQueueItem) (resp *ShipmentQueueItem, err error)
- func (c *APIContext) CreateParcel(ctx context.Context, v *Parcel) (resp *Parcel, err error)
- func (c *APIContext) CreateQueueItem(ctx context.Context, v *ShipmentQueueItem) (resp *ShipmentQueueItem, err error)
- func (c *APIContext) CreateShipment(ctx context.Context, v *Shipment) (resp *Shipment, err error)
- func (c *APIContext) CreateShipments(ctx context.Context, v []*Shipment) (resp []*Shipment, err error)
- func (c *APIContext) DeleteAddress(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteCSVProfile(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteCarrier(ctx context.Context, code CarrierCode) (err error)
- func (c *APIContext) DeleteDHLProduct(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteJob(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteParcel(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteQueueItem(ctx context.Context, id int) (err error)
- func (c *APIContext) DeleteShipment(ctx context.Context, id int) (err error)
- func (c *APIContext) GetAddress(ctx context.Context, id int) (resp *Address, err error)
- func (c *APIContext) GetCSVProfile(ctx context.Context, id int) (resp *CSVProfile, err error)
- func (c *APIContext) GetCarrier(ctx context.Context, code CarrierCode) (resp *Carrier, err error)
- func (c *APIContext) GetJob(ctx context.Context, id int) (resp *ShipmentQueueItem, err error)
- func (c *APIContext) GetLabel(ctx context.Context, id int) (resp *bytes.Buffer, err error)
- func (c *APIContext) GetLabels(ctx context.Context, ids any) (resp *bytes.Buffer, err error)
- func (c *APIContext) GetParcel(ctx context.Context, id int) (resp *Parcel, err error)
- func (c *APIContext) GetQueueItem(ctx context.Context, id int) (resp *ShipmentQueueItem, err error)
- func (c *APIContext) GetShipment(ctx context.Context, id int) (resp *Shipment, err error)
- func (c *APIContext) GetUser(ctx context.Context) (resp *User, err error)
- func (c *APIContext) ListAddresses(ctx context.Context) (resp []*Address, err error)
- func (c *APIContext) ListCSVProfiles(ctx context.Context) (resp []*CSVProfile, err error)
- func (c *APIContext) ListCarriers(ctx context.Context) (resp []*Carrier, err error)
- func (c *APIContext) ListJobs(ctx context.Context) (resp []*ShipmentQueueItem, err error)
- func (c *APIContext) ListParcels(ctx context.Context) (resp []*Parcel, err error)
- func (c *APIContext) ListQueueItems(ctx context.Context) (resp []*ShipmentQueueItem, err error)
- func (c *APIContext) ListShipments(ctx context.Context, page int, size int, order string) (resp []*Shipment, err error)
- func (c *APIContext) Metadata(ctx context.Context) (resp []*CarrierMetadata, err error)
- func (c *APIContext) UpdateAddress(ctx context.Context, v *Address) (err error)
- func (c *APIContext) UpdateCSVProfile(ctx context.Context, v *CSVProfile) (err error)
- func (c *APIContext) UpdateCarrier(ctx context.Context, v *Carrier) (err error)
- func (c *APIContext) UpdateCarrierCredentials(ctx context.Context, v *Carrier) (err error)
- func (c *APIContext) UpdateDHLProduct(ctx context.Context, v *Product) (err error)
- func (c *APIContext) UpdateJob(ctx context.Context, v *ShipmentQueueItem) (err error)
- func (c *APIContext) UpdateParcel(ctx context.Context, v *Parcel) (err error)
- func (c *APIContext) UpdateQueueItem(ctx context.Context, v *ShipmentQueueItem) (err error)
- func (c *APIContext) UploadCSVFile(ctx context.Context, csv []byte, csvProfileID int) (resp []*ShipmentQueueItem, err error)
- func (c *APIContext) ValidateShipment(ctx context.Context, v *Shipment) (err error)
- func (c *APIContext) VerifyCarrier(ctx context.Context, code CarrierCode) (err error)
- type Address
- type AddressTypeCode
- type Amount
- type AuthToken
- type BodyParser
- type CSVProfile
- type Carrier
- type CarrierCode
- type CarrierMetadata
- type CarrierService
- type CarrierServiceCode
- type Client
- func (c *Client) APIContext(token *AuthToken) (*APIContext, error)
- func (c *Client) AuthCodeURL(redirectURL string, state string) string
- func (c *Client) AuthorizationCode(ctx context.Context, authCode string) (resp *AuthToken, err error)
- func (c *Client) ClientCredentials(ctx context.Context) (*AuthToken, error)
- func (c *Client) Development()
- func (c *Client) Production()
- func (c *Client) RefreshToken(ctx context.Context, refreshToken string) (resp *AuthToken, err error)
- func (c *Client) SetHTTPClient(hc *http.Client)
- type Customs
- type CustomsItem
- type EncodingCode
- type Error
- type ExportTypeCode
- type JobStatusCode
- type LabelFormat
- type Mapping
- type Parcel
- type Product
- type ResponseHandler
- type Shipment
- type ShipmentJob
- type ShipmentQueueItem
- type Stats
- type Status
- type User
Constants ¶
const ( HeaderContentTypeJSON = "application/json; charset=utf-8" HeaderContentTypeForm = "application/x-www-form-urlencoded" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type APIContext ¶
type APIContext struct {
// contains filtered or unexported fields
}
APIContext represents the context for making API requests with an authenticated client and token.
It provides methods for sending requests to different endpoints.
func NewAPIContext ¶
func NewAPIContext(c *Client, token *AuthToken) (*APIContext, error)
NewAPIContext creates an API context
func (*APIContext) CreateAddress ¶
CreateAddress creates a new shipment address [POST]: /addresses
func (*APIContext) CreateCSVProfile ¶ added in v1.0.10
func (c *APIContext) CreateCSVProfile(ctx context.Context, v *CSVProfile) (resp *CSVProfile, err error)
CreateCSVProfile creates a csv profile [POST]: /csv/profiles
func (*APIContext) CreateCarrier ¶
CreateCarrier creates a carrier [POST]: /carriers
func (*APIContext) CreateDHLProduct ¶
CreateDHLProduct creates a DHL product [POST]: /carriers/DHL/products
func (*APIContext) CreateJob ¶ added in v1.0.10
func (c *APIContext) CreateJob(ctx context.Context, v *ShipmentQueueItem) (resp *ShipmentQueueItem, err error)
CreateJob creates a job [POST]: /shipments/jobs
func (*APIContext) CreateParcel ¶
CreateParcel creates a parcel [POST]: /parcels
func (*APIContext) CreateQueueItem ¶ added in v1.0.10
func (c *APIContext) CreateQueueItem(ctx context.Context, v *ShipmentQueueItem) (resp *ShipmentQueueItem, err error)
CreateQueueItem creates a queue item [POST]: /shipments/queue
func (*APIContext) CreateShipment ¶
CreateShipment creates a shipment [POST]: /shipments
func (*APIContext) CreateShipments ¶
func (c *APIContext) CreateShipments(ctx context.Context, v []*Shipment) (resp []*Shipment, err error)
CreateShipments creates multiple shipments [POST]: /shipments/bulk
func (*APIContext) DeleteAddress ¶
func (c *APIContext) DeleteAddress(ctx context.Context, id int) (err error)
DeleteAddress deletes a shipment address [DELETE]: /addresses/{id}
func (*APIContext) DeleteCSVProfile ¶ added in v1.0.10
func (c *APIContext) DeleteCSVProfile(ctx context.Context, id int) (err error)
DeleteCSVProfile deletes a csv profile [DELETE]: /csv/profiles/{id}
func (*APIContext) DeleteCarrier ¶
func (c *APIContext) DeleteCarrier(ctx context.Context, code CarrierCode) (err error)
DeleteCarrier deletes a carrier [DELETE]: /carriers/{id}
func (*APIContext) DeleteDHLProduct ¶
func (c *APIContext) DeleteDHLProduct(ctx context.Context, id int) (err error)
DeleteDHLProduct deletes a DHL product [DELETE]: /carriers/DHL/products/{id}
func (*APIContext) DeleteJob ¶ added in v1.0.10
func (c *APIContext) DeleteJob(ctx context.Context, id int) (err error)
DeleteJob deletes a job [DELETE]: /shipments/jobs/{id}
func (*APIContext) DeleteParcel ¶
func (c *APIContext) DeleteParcel(ctx context.Context, id int) (err error)
DeleteParcel deletes a parcel [DELETE]: /parcels/{id}
func (*APIContext) DeleteQueueItem ¶ added in v1.0.10
func (c *APIContext) DeleteQueueItem(ctx context.Context, id int) (err error)
DeleteQueueItem deletes a queue item [DELETE]: /shipments/queue/{id}
func (*APIContext) DeleteShipment ¶
func (c *APIContext) DeleteShipment(ctx context.Context, id int) (err error)
DeleteShipment deletes a shipment [DELETE]: /shipments/{id}
func (*APIContext) GetAddress ¶
GetAddress returns an address [GET]: /addresses/{id}
func (*APIContext) GetCSVProfile ¶ added in v1.0.10
func (c *APIContext) GetCSVProfile(ctx context.Context, id int) (resp *CSVProfile, err error)
GetCSVProfile returns a csv profile [GET]: /csv/profiles/{id}
func (*APIContext) GetCarrier ¶
func (c *APIContext) GetCarrier(ctx context.Context, code CarrierCode) (resp *Carrier, err error)
GetCarrier returns a carrier [GET]: /carriers/{id}
func (*APIContext) GetJob ¶ added in v1.0.10
func (c *APIContext) GetJob(ctx context.Context, id int) (resp *ShipmentQueueItem, err error)
GetJob returns a job [GET]: /shipments/jobs/{id}
func (*APIContext) GetLabel ¶
GetLabel returns a shipment label in PDF format [GET]: /shipments/{id}
func (*APIContext) GetLabels ¶
GetLabels returns labels in PDF format [GET]: /shipments/labels/{id1,id2,...,idn} Value: 'ids' can be from type []string or []int
func (*APIContext) GetQueueItem ¶ added in v1.0.10
func (c *APIContext) GetQueueItem(ctx context.Context, id int) (resp *ShipmentQueueItem, err error)
GetQueueItem returns a queue item [GET]: /shipments/queue/{id}
func (*APIContext) GetShipment ¶
GetShipment returns a shipment [GET]: /shipments/{id}
func (*APIContext) GetUser ¶
func (c *APIContext) GetUser(ctx context.Context) (resp *User, err error)
GetUser returns the user details [GET]: /user
func (*APIContext) ListAddresses ¶
func (c *APIContext) ListAddresses(ctx context.Context) (resp []*Address, err error)
ListAddresses returns all available user addresses [GET]: /addresses
func (*APIContext) ListCSVProfiles ¶ added in v1.0.10
func (c *APIContext) ListCSVProfiles(ctx context.Context) (resp []*CSVProfile, err error)
ListCSVProfiles returns all csv profiles [GET]: /csv/profiles
func (*APIContext) ListCarriers ¶
func (c *APIContext) ListCarriers(ctx context.Context) (resp []*Carrier, err error)
ListCarriers returns all user created carriers [GET]: /carriers
func (*APIContext) ListJobs ¶ added in v1.0.10
func (c *APIContext) ListJobs(ctx context.Context) (resp []*ShipmentQueueItem, err error)
ListJobs returns all jobs [GET]: /shipments/jobs
func (*APIContext) ListParcels ¶
func (c *APIContext) ListParcels(ctx context.Context) (resp []*Parcel, err error)
ListParcels returns all parcels [GET]: /parcels
func (*APIContext) ListQueueItems ¶ added in v1.0.10
func (c *APIContext) ListQueueItems(ctx context.Context) (resp []*ShipmentQueueItem, err error)
ListQueueItems returns all queue items [GET]: /shipments/queue
func (*APIContext) ListShipments ¶
func (c *APIContext) ListShipments(ctx context.Context, page int, size int, order string) (resp []*Shipment, err error)
ListShipments returns all shipments [GET]: /shipments Query parameters: page: The page number to retrieve for the list of shipments. For example page = 0 and page_size = 10 return the first 10 shipments. page = 1 and page_size=10 return the next shipments (11-20). Default: 0 page_size: The maximum number of shipments to return in the response. Must be an integer between 0 and 10000. Default: 10000 order: Specifies the order of shipments. Available values are 'asc' or 'desc'. Default: asc
func (*APIContext) Metadata ¶
func (c *APIContext) Metadata(ctx context.Context) (resp []*CarrierMetadata, err error)
Metadata returns the carrier metadata [GET]: /metadata/carriers
func (*APIContext) UpdateAddress ¶
func (c *APIContext) UpdateAddress(ctx context.Context, v *Address) (err error)
UpdateAddress updates a shipment address [PUT]: /addresses/{id}
func (*APIContext) UpdateCSVProfile ¶ added in v1.0.10
func (c *APIContext) UpdateCSVProfile(ctx context.Context, v *CSVProfile) (err error)
UpdateCSVProfile updates a csv profile [PUT]: /csv/profiles/{id}
func (*APIContext) UpdateCarrier ¶
func (c *APIContext) UpdateCarrier(ctx context.Context, v *Carrier) (err error)
UpdateCarrier updates a carrier [PUT]: /carriers/{id}
func (*APIContext) UpdateCarrierCredentials ¶
func (c *APIContext) UpdateCarrierCredentials(ctx context.Context, v *Carrier) (err error)
UpdateCarrierCredentials updates the user credentials from the carrier [PUT]: /carriers/{id}/cred
func (*APIContext) UpdateDHLProduct ¶
func (c *APIContext) UpdateDHLProduct(ctx context.Context, v *Product) (err error)
UpdateDHLProduct updates a DHL product [PUT]: /carriers/DHL/products/{id}
func (*APIContext) UpdateJob ¶ added in v1.0.10
func (c *APIContext) UpdateJob(ctx context.Context, v *ShipmentQueueItem) (err error)
UpdateJob updates a job [PUT]: /shipments/jobs/{id}
func (*APIContext) UpdateParcel ¶
func (c *APIContext) UpdateParcel(ctx context.Context, v *Parcel) (err error)
UpdateParcel updates a parcel [PUT]: /parcels/{id}
func (*APIContext) UpdateQueueItem ¶ added in v1.0.10
func (c *APIContext) UpdateQueueItem(ctx context.Context, v *ShipmentQueueItem) (err error)
UpdateQueueItem updates a queue item [PUT]: /shipments/queue/{id}
func (*APIContext) UploadCSVFile ¶ added in v1.0.10
func (c *APIContext) UploadCSVFile(ctx context.Context, csv []byte, csvProfileID int) (resp []*ShipmentQueueItem, err error)
UploadCSVFile uploads a csv file and sets the items in the shipment queue [POST]: /shipments/queue/csv
func (*APIContext) ValidateShipment ¶
func (c *APIContext) ValidateShipment(ctx context.Context, v *Shipment) (err error)
ValidateShipment validates a shipment [POST]: /shipments/validate
func (*APIContext) VerifyCarrier ¶
func (c *APIContext) VerifyCarrier(ctx context.Context, code CarrierCode) (err error)
VerifyCarrier validates the user credentials [POST]: /carriers/{id}/verify
type Address ¶ added in v1.0.1
type Address struct { ID int `json:"id,omitempty"` Company string `json:"company,omitempty"` // Name 1 FirstName string `json:"firstName,omitempty"` // Name 2 LastName string `json:"lastName,omitempty"` // Name 3 Street string `json:"street,omitempty"` StreetNumber string `json:"streetNumber,omitempty"` PostalCode string `json:"postalCode,omitempty"` AddressAddition string `json:"addressAddition,omitempty"` City string `json:"city,omitempty"` Country string `json:"country,omitempty"` State string `json:"state,omitempty"` Mail string `json:"mail,omitempty"` Phone string `json:"phone,omitempty"` VATNumber string `json:"vatNumber,omitempty"` AddressType AddressTypeCode `json:"addressType,omitempty"` }
type AddressTypeCode ¶ added in v1.0.1
type AddressTypeCode string
const ( AddressTypeShipping AddressTypeCode = "SHIPPING" AddressTypeReturn AddressTypeCode = "RETURN" )
type AuthToken ¶ added in v1.0.1
type AuthToken struct { AccessToken string `json:"accessToken,omitempty"` ExpiresIn int `json:"expiresIn,omitempty"` RefreshToken string `json:"refreshToken,omitempty"` RefreshTokenExpiresIn int `json:"refreshTokenExpiresIn,omitempty"` TokenType string `json:"tokenType,omitempty"` // contains filtered or unexported fields }
func (*AuthToken) IsExpired ¶ added in v1.0.1
IsExpired returns whether the access token has expired
func (*AuthToken) SetAccessToken ¶ added in v1.0.1
SetAccessToken updates the struct and sets a new access token
func (*AuthToken) SetExpirationTime ¶ added in v1.0.1
func (m *AuthToken) SetExpirationTime()
SetExpirationTime converts the ExpiresIn value to a time.Time
type BodyParser ¶
type BodyParser func() (io.ReadCloser, error)
type CSVProfile ¶ added in v1.0.10
type CSVProfile struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Delimiter string `json:"delimiter,omitempty"` DateFormat string `json:"dateFormat,omitempty"` Encoding EncodingCode `json:"encoding,omitempty"` Mapping []*Mapping `json:"mapping,omitempty"` IsDefault bool `json:"isDefault,omitempty"` Created *time.Time `json:"created,omitempty"` }
type Carrier ¶ added in v1.0.1
type Carrier struct { Code CarrierCode `json:"carrierCode,omitempty"` Name string `json:"name,omitempty"` IsDefault bool `json:"isDefault,omitempty"` Username string `json:"username,omitempty"` UserSecret string `json:"userSecret,omitempty"` UserSecretExpiration *time.Time `json:"userSecretExpiration,omitempty"` Product string `json:"product,omitempty"` LabelFormat string `json:"labelFormat,omitempty"` // Default label format for shipments Created *time.Time `json:"created,omitempty"` Services []*CarrierService `json:"services,omitempty"` // Additional carrier services Parameters map[string]any `json:"parameters,omitempty"` // Additional parameters for the carrier (e.h. DHL EKP) }
type CarrierCode ¶ added in v1.0.1
type CarrierCode string
const ( CarrierDHL CarrierCode = "DHL" CarrierDP CarrierCode = "DP" CarrierDPD CarrierCode = "DPD" CarrierGLS CarrierCode = "GLS" CarrierHermes CarrierCode = "HERMES" CarrierUPS CarrierCode = "UPS" CarrierPostAT CarrierCode = "POST_AT" CarrierDHLExpress CarrierCode = "DHL_EXPRESS" )
type CarrierMetadata ¶ added in v1.0.1
type CarrierMetadata struct { Code CarrierCode `json:"carrierCode,omitempty"` Name string `json:"name,omitempty"` Products []*Product `json:"products,omitempty"` LabelFormats []*LabelFormat `json:"labelFormats,omitempty"` }
type CarrierService ¶ added in v1.0.2
type CarrierService struct { Service CarrierServiceCode `json:"service,omitempty"` Parameters map[string]any `json:"parameters,omitempty"` }
func (*CarrierService) AddParameter ¶ added in v1.0.2
func (m *CarrierService) AddParameter(key string, param any)
type CarrierServiceCode ¶ added in v1.0.2
type CarrierServiceCode string
const ( CarrierServicePreferredNeighbour CarrierServiceCode = "PREFERRED_NEIGHBOUR" CarrierServicePreferredLocation CarrierServiceCode = "PREFERRED_LOCATION" CarrierServiceVisualCheckOfAge CarrierServiceCode = "VISUAL_CHECK_OF_AGE" CarrierServiceNamedPersonOnly CarrierServiceCode = "NAMED_PERSON_ONLY" CarrierServiceIdentCheck CarrierServiceCode = "IDENT_CHECK" CarrierServicePreferredDay CarrierServiceCode = "PREFERRED_DAY" CarrierServiceNoNeighbourDelivery CarrierServiceCode = "NO_NEIGHBOUR_DELIVERY" CarrierServiceAdditionalInsurance CarrierServiceCode = "ADDITIONAL_INSURANCE" CarrierServiceBulkyGoods CarrierServiceCode = "BULKY_GOODS" CarrierServiceCashOnDelivery CarrierServiceCode = "CASH_ON_DELIVERY" CarrierServicePackagingReturn CarrierServiceCode = "PACKAGING_RETURN" CarrierServiceParcelOutletRouting CarrierServiceCode = "PARCEL_OUTLET_ROUTING" CarrierServiceFlexDelivery CarrierServiceCode = "FLEX_DELIVERY" CarrierServiceNextDay CarrierServiceCode = "NEXT_DAY" CarrierServiceShopReturn CarrierServiceCode = "SHOP_RETURN" CarrierServiceShopDelivery CarrierServiceCode = "SHOP_DELIVERY" CarrierServiceIdentPin CarrierServiceCode = "IDENT_PIN" CarrierServiceSaturdayDelivery CarrierServiceCode = "SATURDAY_DELIVERY" CarrierServiceNoShipmentRedirection CarrierServiceCode = "NO_SHIPMENT_REDIRECTION" CarrierServiceNoShopAuthorization CarrierServiceCode = "NO_SHOP_AUTHORIZATION" CarrierServiceHazardousGoods CarrierServiceCode = "HAZARDOUS_GOODS" CarrierServiceFragile CarrierServiceCode = "FRAGILE" CarrierServicePremium CarrierServiceCode = "PREMIUM" CarrierServicePickup CarrierServiceCode = "PICKUP" CarrierServiceSignature CarrierServiceCode = "SIGNATURE" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) APIContext ¶
func (c *Client) APIContext(token *AuthToken) (*APIContext, error)
APIContext creates a token specific context for the REST API
func (*Client) AuthCodeURL ¶
AuthCodeURL creates a redirect url for the shippinglabel oauth process (AuthorizationCode)
func (*Client) AuthorizationCode ¶
func (c *Client) AuthorizationCode(ctx context.Context, authCode string) (resp *AuthToken, err error)
AuthorizationCode exchanges the authorization code for an access token
func (*Client) ClientCredentials ¶
ClientCredentials creates an access token with the client credentials
func (*Client) Development ¶
func (c *Client) Development()
Development sets the developmentURL as default
func (*Client) Production ¶
func (c *Client) Production()
Production sets the productionURL as default
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(ctx context.Context, refreshToken string) (resp *AuthToken, err error)
RefreshToken creates an access token through a refresh token
func (*Client) SetHTTPClient ¶
SetHTTPClient sets the default http.Client
type Customs ¶ added in v1.0.9
type Customs struct { ExportType ExportTypeCode `json:"exportType,omitempty"` ExportDescription string `json:"exportDescription,omitempty"` ShippingCosts *Amount `json:"shippingCosts,omitempty"` InvoiceNumber string `json:"invoiceNumber,omitempty"` InvoiceDate string `json:"invoiceDate,omitempty"` SenderCustomsReference string `json:"senderCustomsReference,omitempty"` ReceiverCustomsReference string `json:"receiverCustomsReference,omitempty"` HasElectronicExportNotification bool `json:"hasElectronicExportNotification,omitempty"` Items []*CustomsItem `json:"items,omitempty"` }
type CustomsItem ¶ added in v1.0.9
type CustomsItem struct { Description string `json:"description,omitempty"` Quantity int `json:"quantity,omitempty"` HsCode string `json:"hsCode,omitempty"` OriginCountry string `json:"originCountry,omitempty"` UnitValue *Amount `json:"unitValue,omitempty"` Weight float64 `json:"weight,omitempty"` }
type EncodingCode ¶ added in v1.0.10
type EncodingCode string
const ( EncodingUTF8 EncodingCode = "UTF-8" EncodingISO88591 EncodingCode = "ISO-8859-1" EncodingUTF8BOM EncodingCode = "UTF-8-BOM" )
type Error ¶ added in v1.0.1
type ExportTypeCode ¶ added in v1.0.9
type ExportTypeCode string
const ( ExportTypeOther ExportTypeCode = "OTHER" ExportTypePresent ExportTypeCode = "PRESENT" ExportTypeSample ExportTypeCode = "SAMPLE" ExportTypeDocument ExportTypeCode = "DOCUMENT" ExportTypeReturnOfGoods ExportTypeCode = "RETURN_OF_GOODS" ExportTypeCommercialGoods ExportTypeCode = "COMMERCIAL_GOODS" )
type JobStatusCode ¶ added in v1.0.10
type JobStatusCode string
const ( JobStatusCreated JobStatusCode = "CREATED" JobStatusRunning JobStatusCode = "RUNNING" JobStatusCancelled JobStatusCode = "CANCELLED" JobStatusCompleted JobStatusCode = "COMPLETED" )
type LabelFormat ¶ added in v1.0.2
type Parcel ¶ added in v1.0.1
type Parcel struct { ID int `json:"id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Weight float64 `json:"weight,omitempty"` Length float64 `json:"length,omitempty"` Width float64 `json:"width,omitempty"` Height float64 `json:"height,omitempty"` Reference string `json:"reference,omitempty"` CustomFields map[string]any `json:"customFields,omitempty"` IsDefault bool `json:"isDefault,omitempty"` }
type Product ¶ added in v1.0.2
type Product struct { ID int `json:"id,omitempty"` Product string `json:"product,omitempty"` Name string `json:"name,omitempty"` UserParticipation string `json:"userParticipation,omitempty"` Annotation string `json:"annotation,omitempty"` Price float64 `json:"price,omitempty"` IsInternational bool `json:"isInternational,omitempty"` MinWeight int `json:"minWeight,omitempty"` MaxWeight int `json:"maxWeight,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` MinWidth int `json:"minWidth,omitempty"` MaxWidth int `json:"maxWidth,omitempty"` MinHeight int `json:"minHeight,omitempty"` MaxHeight int `json:"maxHeight,omitempty"` }
type ResponseHandler ¶
type Shipment ¶ added in v1.0.1
type Shipment struct { ID int `json:"id,omitempty"` ShipmentNumber string `json:"shipmentNumber,omitempty"` Carrier *Carrier `json:"carrier,omitempty"` Parcels []*Parcel `json:"parcels,omitempty"` Sender *Address `json:"sender,omitempty"` Receiver *Address `json:"receiver,omitempty"` Reference string `json:"reference,omitempty"` ShipmentDate *time.Time `json:"shipmentDate,omitempty"` Customs *Customs `json:"customs,omitempty"` Created *time.Time `json:"created,omitempty"` AdditionalDetails map[string]any `json:"additionalDetails,omitempty"` Label string `json:"label,omitempty"` Status *Status `json:"status,omitempty"` }
type ShipmentJob ¶ added in v1.0.10
type ShipmentJob struct { ID int `json:"id,omitempty"` Status JobStatusCode `json:"status,omitempty"` ExecutionTime *time.Time `json:"executionTime,omitempty"` LastUpdate time.Time `json:"lastUpdate,omitempty"` Created time.Time `json:"created,omitempty"` QueueItems []*ShipmentQueueItem `json:"queueItems,omitempty"` TotalQueueItems int `json:"totalQueueItems,omitempty"` ProcessedQueueItems int `json:"processedQueueItems,omitempty"` }
type ShipmentQueueItem ¶ added in v1.0.10
type User ¶ added in v1.0.1
type User struct { ID int `json:"id,omitempty"` Email string `json:"email,omitempty"` Lang string `json:"language,omitempty"` RegisterDate *time.Time `json:"registerDate,omitempty"` LastSeen *time.Time `json:"lastSeen,omitempty"` Balance float64 `json:"balance,omitempty"` Address *Address `json:"address,omitempty"` ShipmentStats *Stats `json:"shipmentStats,omitempty"` }