Documentation ¶
Index ¶
- type Activate
- type ActivateParams
- type CancelledOrder
- type DetailOrder
- type DetailOrderV3
- type DomesticOrder
- func CreateDomesticOrder(params *DomesticOrderParams) (DomesticOrder, error)
- func CreateDomesticOrderWithContext(ctx context.Context, params *DomesticOrderParams) (DomesticOrder, error)
- func GetTrackingID(orderID string) (DomesticOrder, error)
- func GetTrackingIDWithContext(ctx context.Context, orderID string) (DomesticOrder, error)
- type DomesticOrderParams
- type DomesticOrderParamsV3
- type DomesticOrderV3
- type InternationalOrder
- type InternationalOrderParams
- type ItemName
- type ItemV3
- type LogisticStatusV3
- type PackageDetail
- type ShipperStatus
- type TrackingsV3
- type UpdateOrderParams
- type UpdatedOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Activate ¶
type Activate struct { Status string `json:"status"` Data struct { Message string `json:"message"` StatusCode int `json:"statusCode"` } `json:"data"` }
Activate struct contains response from API ActivateOrder.
func ActivateOrder ¶
func ActivateOrder(orderID string, params *ActivateParams) (Activate, error)
ActivateOrder activates (initiate Shipper's pickup process) or Deactivate an Order.
func ActivateOrderWithContext ¶
func ActivateOrderWithContext(ctx context.Context, orderID string, params *ActivateParams) (Activate, error)
ActivateOrderWithContext activates (initiate Shipper's pickup process) or Deactivate an Order with context.
type ActivateParams ¶
type ActivateParams struct { Active int `json:"active" validate:"required"` AgentID int `json:"agentId"` }
ActivateParams struct contains request parameter for API ActivateOrder.
type CancelledOrder ¶
type CancelledOrder struct { Status string `json:"status"` Data struct { Title string `json:"title"` Message string `json:"message"` StatusCode int `json:"statusCode"` } `json:"data"` }
CancelledOrder struct contains response from API CancelOrder.
func CancelOrder ¶
func CancelOrder(orderID string) (CancelledOrder, error)
CancelOrder cancels specific created order.
func CancelOrderWithContext ¶
func CancelOrderWithContext(ctx context.Context, orderID string) (CancelledOrder, error)
CancelOrderWithContext cancels specific created order with context.
type DetailOrder ¶
type DetailOrder struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` Order struct { Tracking []tracking `json:"tracking"` Detail struct { ID string `json:"_id"` TrackingID string `json:"id"` GroupID int `json:"groupID"` SpecialID string `json:"specialID"` ExternalID string `json:"externalID"` LabelChecksum string `json:"labelChecksum"` Consigner struct { ID string `json:"id"` Name string `json:"name"` PhoneNumber string `json:"phoneNumber"` } Consignee struct { ID string `json:"id"` Name string `json:"name"` PhoneNumber string `json:"phoneNumber"` } BatchID int `json:"batchID"` AWBNumber string `json:"awbNumber"` StickerNumber string `json:"stickerNumber"` ShipmentStatus shipmentStatus `json:"shipmentStatus"` InternalStatus shipmentStatus `json:"internalStatus"` ExternalStatus shipmentStatus `json:"externalStatus"` Origin origin `json:"origin"` Destination origin `json:"destination"` Package struct { ItemType string `json:"itemType"` Contents string `json:"contents"` Price item `json:"price"` ItemName int `json:"itemName"` Dimension struct { Length item `json:"length"` Width item `json:"width"` Height item `json:"height"` } `json:"dimension"` Weight item `json:"weight"` CubicalWeight item `json:"cubicalWeight"` Fragile int `json:"fragile"` Type int `json:"type"` IsConfirmed int `json:"isConfirmed"` PictureURL string `json:"pictureURL"` Details []PackageDetail `json:"details"` } `json:"package"` Driver struct { ID int `json:"id"` Name string `json:"name"` PhoneNumber string `json:"phoneNumber"` VehicleType string `json:"vehicleType"` VehicleNumber string `json:"vehicleNumber"` IsPaymentCollected int `json:"isPaymentCollected"` Feedback struct { Score int `json:"score"` Comment string `json:"comment"` } `json:"feedback"` AgentID int `json:"agentID"` AgentName string `json:"agentName"` AgentCityID int `json:"agentCityID"` } `json:"driver"` Courier struct { ID int `json:"id"` Name string `json:"name"` RateID int `json:"rate_id"` RateName string `json:"rate_name"` ShipmentType int `json:"shipmentType"` ActualID int `json:"actualID"` MinDay int `json:"min_day"` MaxDay int `json:"max_day"` Rate item `json:"rate"` ActualRate struct { ID int `json:"id"` // contains filtered or unexported fields } `json:"actualRate"` } `json:"courier"` Rates struct { Shipment item `json:"shipment"` PaidShipment item `json:"paidShipment"` ActualShipment item `json:"actualShipment"` Insurance item `json:"insurance"` PaidInsurance item `json:"paidInsurance"` ActualInsurance item `json:"actualInsurance"` EscrowCost item `json:"escrowCost"` FulfillmentCost item `json:"fulfillmentCost"` ItemPrice item `json:"itemPrice"` Discount item `json:"discount"` } `json:"rates"` UseInsurance bool `json:"useInsurance"` IsLabelPrinted int `json:"isLabelPrinted"` PaymentType string `json:"paymentType"` Source string `json:"source"` IsActive bool `json:"isActive"` IsAutoTrack int `json:"isAutoTrack"` IsCustomAWB int `json:"isCustomAWB"` ReadyTime string `json:"readyTime"` PickUpTime string `json:"pickUpTime"` PickUpCode string `json:"PickUpCode"` CreationDate string `json:"creationDate"` ActiveDate string `json:"activeDate"` LastUpdatedDate string `json:"lastUpdatedDate"` CreatedBy int `json:"createdBy"` ShipmentArea string `json:"shipmentArea"` COD struct { Order int `json:"order"` FreeDelivery int `json:"freeDelivery"` } `json:"cod"` Voucher string `json:"voucher"` Whitelabel string `json:"whitelabel"` JOBNumber string `json:"JOBNumber"` Domain string `json:"domain"` IsAutomateOrder int `json:"isAutomateOrder"` Channel string `json:"channel"` IsHubless int `json:"isHubless"` ZonaID int `json:"zonaID"` IsJobMarketplace int `json:"isJobMarketplace"` RequestID string `json:"requestID"` PartitionKey int `json:"partitionKey"` HandlerIDs []int `json:"handler_ids"` } `json:"detail"` } `json:"order"` StatusCode int `json:"statusCode"` } `json:"data"` }
DetailOrder struct contains response from API GetOrderDetail.
func GetOrderDetail ¶
func GetOrderDetail(orderID string) (DetailOrder, error)
GetOrderDetail gets created order's detail.
func GetOrderDetailWithContext ¶
func GetOrderDetailWithContext(ctx context.Context, orderID string) (DetailOrder, error)
GetOrderDetailWithContext gets created order's detail with context.
type DetailOrderV3 ¶ added in v1.0.0
type DetailOrderV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data struct { Consignee struct { Name string `json:"name"` PhoneNumber string `json:"phone_number"` Email string `json:"email"` } `json:"consignee"` Consigner struct { Name string `json:"name"` PhoneNumber string `json:"phone_number"` Email string `json:"email"` } `json:"consigner"` Origin struct { Id int `json:"id"` StopId int `json:"stop_id"` Address string `json:"address"` Direction string `json:"direction"` Postcode string `json:"postcode"` AreaId int `json:"area_id"` AreaName string `json:"area_name"` SuburbId int `json:"suburb_id"` SuburbName string `json:"suburb_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` ProvinceId int `json:"province_id"` ProvinceName string `json:"province_name"` CountryId int `json:"country_id"` CountryName string `json:"country_name"` Lat string `json:"lat"` Lng string `json:"lng"` EmailAddress string `json:"email_address"` CompanyName string `json:"company_name"` } `json:"origin"` Destination struct { Id int `json:"id"` StopId int `json:"stop_id"` Address string `json:"address"` Direction string `json:"direction"` Postcode string `json:"postcode"` AreaId int `json:"area_id"` AreaName string `json:"area_name"` SuburbId int `json:"suburb_id"` SuburbName string `json:"suburb_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` ProvinceId int `json:"province_id"` ProvinceName string `json:"province_name"` CountryId int `json:"country_id"` CountryName string `json:"country_name"` Lat string `json:"lat"` Lng string `json:"lng"` EmailAddress string `json:"email_address"` CompanyName string `json:"company_name"` } `json:"destination"` ExternalId string `json:"external_id"` OrderId string `json:"order_id"` Courier struct { Name string `json:"name"` RateId int `json:"rate_id"` RateName string `json:"rate_name"` Amount float64 `json:"amount"` UseInsurance bool `json:"use_insurance"` InsuranceAmount float64 `json:"insurance_amount"` Cod bool `json:"cod"` MinDay int `json:"min_day"` MaxDay int `json:"max_day"` PriceBreakdown struct { SurchargeFee float64 `json:"surcharge_fee"` BasePrice float64 `json:"base_price"` Discount float64 `json:"discount"` InsuranceFee float64 `json:"insurance_fee"` FinalPrice float64 `json:"final_price"` } `json:"price_breakdown"` } `json:"courier"` Package struct { Weight float64 `json:"weight"` Length float64 `json:"length"` Width float64 `json:"width"` Height float64 `json:"height"` VolumeWeight float64 `json:"volume_weight"` PackageType int `json:"package_type"` Items []struct { Id int `json:"id"` Name string `json:"name"` Price float64 `json:"price"` Qty int `json:"qty"` } `json:"items"` International struct { CustomDeclaration struct { AdditionalDocument []interface{} `json:"additional_document"` DocumentNumber string `json:"document_number"` TaxDocument string `json:"tax_document"` } `json:"custom_declaration"` DescriptionItem string `json:"description_item"` DestinationPacket string `json:"destination_packet"` ItemType string `json:"item_type"` MadeIn string `json:"made_in"` Quantity int `json:"quantity"` Reason string `json:"reason"` Unit string `json:"unit"` } `json:"international"` ItemCategories []interface{} `json:"item_categories"` } `json:"package"` PaymentType string `json:"payment_type"` Driver struct { Name string `json:"name"` Phone string `json:"phone"` VehicleType string `json:"vehicle_type"` VehicleNumber string `json:"vehicle_number"` } `json:"driver"` LabelCheckSum string `json:"label_check_sum"` CreationDate time.Time `json:"creation_date"` LastUpdatedDate time.Time `json:"last_updated_date"` AwbNumber string `json:"awb_number"` Trackings []TrackingsV3 `json:"trackings"` IsActive bool `json:"is_active"` IsHubless bool `json:"is_hubless"` PickupCode string `json:"pickup_code"` PickupTime string `json:"pickup_time"` ShipmentStatus struct { Name string `json:"name"` Description string `json:"description"` Code int `json:"code"` UpdatedBy string `json:"updated_by"` UpdatedDate time.Time `json:"updated_date"` TrackUrl string `json:"track_url"` Reason string `json:"reason"` CreatedDate time.Time `json:"created_date"` } `json:"shipment_status"` ProofOfDelivery struct { Photo string `json:"photo"` Signature string `json:"signature"` } `json:"proof_of_delivery"` TimeSlotSelected struct { StartTime interface{} `json:"start_time"` EndTime interface{} `json:"end_time"` } `json:"time_slot_selected"` } `json:"data"` }
func (DetailOrderV3) ToDetailOrder ¶ added in v1.0.0
func (r DetailOrderV3) ToDetailOrder() DetailOrder
type DomesticOrder ¶
type DomesticOrder struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` StatusCode int `json:"statusCode"` ID string `json:"id"` } `json:"data"` }
DomesticOrder struct contains response from API CreateDomesticOrder.
func CreateDomesticOrder ¶
func CreateDomesticOrder(params *DomesticOrderParams) (DomesticOrder, error)
CreateDomesticOrder creates Shipper domestic order.
func CreateDomesticOrderWithContext ¶
func CreateDomesticOrderWithContext(ctx context.Context, params *DomesticOrderParams) (DomesticOrder, error)
CreateDomesticOrderWithContext creates Shipper domestic order with context.
func GetTrackingID ¶
func GetTrackingID(orderID string) (DomesticOrder, error)
GetTrackingID gets the Tracking ID based on submitted order ID.
func GetTrackingIDWithContext ¶
func GetTrackingIDWithContext(ctx context.Context, orderID string) (DomesticOrder, error)
GetTrackingIDWithContext gets the Tracking ID based on submitted order ID with context.
type DomesticOrderParams ¶
type DomesticOrderParams struct { Origin int `json:"o" validate:"required"` Destination int `json:"d" validate:"required"` Length float64 `json:"l" validate:"required"` Width float64 `json:"w" validate:"required"` Height float64 `json:"h" validate:"required"` WeightTotal float64 `json:"wt" validate:"required"` Value float64 `json:"v" validate:"required"` RateID int `json:"rateID" validate:"required"` ConsigneeName string `json:"consigneeName" validate:"required"` ConsigneePhoneNumber string `json:"consigneePhoneNumber" validate:"required"` ConsignerName string `json:"consignerName"` ConsignerPhoneNumber string `json:"consignerPhoneNumber"` OriginAddress string `json:"originAddress" validate:"required"` OriginDirection string `json:"originDirection" validate:"required"` DestinationAddress string `json:"destinationAddress" validate:"required"` DestinationDirection string `json:"destinationDirection" validate:"required"` ItemName []ItemName `json:"itemName" validate:"required"` Contents string `json:"contents" validate:"required"` UseInsurance bool `json:"useInsurance"` ExternalID string `json:"externalID"` PaymentType string `json:"paymentType"` PackageType int `json:"packageType" validate:"required"` COD bool `json:"cod"` OriginCoordinate *string `json:"originCoord"` DestinationCoordinate *string `json:"destinationCoord"` }
DomesticOrderParams struct contains request parameter for API CreateDomesticOrder.
func (DomesticOrderParams) ToDomesticOrderParams ¶ added in v1.0.0
func (r DomesticOrderParams) ToDomesticOrderParams() DomesticOrderParamsV3
type DomesticOrderParamsV3 ¶ added in v1.0.0
type DomesticOrderParamsV3 struct { Consignee struct { Name string `json:"name"` PhoneNumber string `json:"phone_number"` } `json:"consignee"` Consigner struct { Name string `json:"name"` PhoneNumber string `json:"phone_number"` } `json:"consigner"` Courier struct { Cod bool `json:"cod"` RateId int `json:"rate_id"` UseInsurance bool `json:"use_insurance"` } `json:"courier"` Coverage string `json:"coverage"` Destination struct { Address string `json:"address"` AreaId int `json:"area_id"` Lat string `json:"lat"` Lng string `json:"lng"` } `json:"destination"` ExternalId string `json:"external_id"` Origin struct { Address string `json:"address"` AreaId int `json:"area_id"` Lat string `json:"lat"` Lng string `json:"lng"` } `json:"origin"` Package struct { Height float64 `json:"height"` Items []ItemV3 `json:"items"` Length float64 `json:"length"` PackageType int `json:"package_type"` Price float64 `json:"price"` Weight float64 `json:"weight"` Width float64 `json:"width"` } `json:"package"` PaymentType string `json:"payment_type"` }
type DomesticOrderV3 ¶ added in v1.0.0
type DomesticOrderV3 struct { Metadata struct { Path string `json:"path"` HttpStatusCode int `json:"http_status_code"` HttpStatus string `json:"http_status"` Timestamp int `json:"timestamp"` } `json:"metadata"` Data struct { Coverage string `json:"coverage"` ExternalId string `json:"external_id"` OrderId string `json:"order_id"` PaymentType string `json:"payment_type"` Courier struct { RateId int `json:"rate_id"` Amount int `json:"amount"` UseInsurance bool `json:"use_insurance"` InsuranceAmount int `json:"insurance_amount"` Cod bool `json:"cod"` } `json:"courier"` Consignee struct { Name string `json:"name"` Email string `json:"email"` PhoneNumber string `json:"phone_number"` } `json:"consignee"` Consigner struct { Name string `json:"name"` Email string `json:"email"` PhoneNumber string `json:"phone_number"` } `json:"consigner"` Destination struct { Address string `json:"address"` AreaId int `json:"area_id"` AreaName string `json:"area_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` CountryId int `json:"country_id"` CountryName string `json:"country_name"` Lat string `json:"lat"` Lng string `json:"lng"` Postcode string `json:"postcode"` ProvinceId int `json:"province_id"` ProvinceName string `json:"province_name"` SuburbId int `json:"suburb_id"` SuburbName string `json:"suburb_name"` EmailAddress string `json:"email_address"` CompanyName string `json:"company_name"` } `json:"destination"` Origin struct { Address string `json:"address"` AreaId int `json:"area_id"` AreaName string `json:"area_name"` CityId int `json:"city_id"` CityName string `json:"city_name"` CountryId int `json:"country_id"` CountryName string `json:"country_name"` Lat string `json:"lat"` Lng string `json:"lng"` Postcode string `json:"postcode"` ProvinceId int `json:"province_id"` ProvinceName string `json:"province_name"` SuburbId int `json:"suburb_id"` SuburbName string `json:"suburb_name"` EmailAddress string `json:"email_address"` CompanyName string `json:"company_name"` } `json:"origin"` Package struct { PackageType int `json:"package_type"` Weight float64 `json:"weight"` Length int `json:"length"` Width int `json:"width"` Height int `json:"height"` Price int `json:"price"` Items []struct { Id int `json:"id"` Name string `json:"name"` Qty int `json:"qty"` Price int `json:"price"` } `json:"items"` International struct { CustomDeclaration struct { AdditionalDocument interface{} `json:"additional_document"` DocumentNumber string `json:"document_number"` TaxDocument string `json:"tax_document"` } `json:"custom_declaration"` DescriptionItem string `json:"description_item"` DestinationPacket string `json:"destination_packet"` ItemType string `json:"item_type"` MadeIn string `json:"made_in"` Quantity int `json:"quantity"` Reason string `json:"reason"` Unit string `json:"unit"` } `json:"international"` ItemCategories []interface{} `json:"item_categories"` } `json:"package"` } `json:"data"` }
func (DomesticOrderV3) ToDomesticOrder ¶ added in v1.0.0
func (r DomesticOrderV3) ToDomesticOrder() DomesticOrder
type InternationalOrder ¶
type InternationalOrder struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` StatusCode int `json:"statusCode"` ID string `json:"id"` } `json:"data"` }
InternationalOrder struct contains response from API CreateInternationalOrder.
func CreateInternationalOrder ¶
func CreateInternationalOrder(params *InternationalOrderParams) (InternationalOrder, error)
CreateInternationalOrder creates Shipper international order.
func CreateInternationalOrderWithContext ¶
func CreateInternationalOrderWithContext(ctx context.Context, params *InternationalOrderParams) (InternationalOrder, error)
CreateInternationalOrderWithContext creates Shipper international order with context.
type InternationalOrderParams ¶
type InternationalOrderParams struct { Origin int `json:"o" validate:"required"` Destination int `json:"d" validate:"required"` Length float64 `json:"l" validate:"required"` Width float64 `json:"w" validate:"required"` Height float64 `json:"h" validate:"required"` WeightTotal float64 `json:"wt" validate:"required"` Value float64 `json:"v" validate:"required"` RateID int `json:"rateID" validate:"required"` ConsigneeName string `json:"consigneeName" validate:"required"` ConsigneePhoneNumber string `json:"consigneePhoneNumber" validate:"required"` ConsignerName string `json:"consignerName"` ConsignerPhoneNumber string `json:"consignerPhoneNumber"` OriginAddress string `json:"originAddress" validate:"required"` OriginDirection string `json:"originDirection" validate:"required"` DestinationAddress string `json:"destinationAddress" validate:"required"` DestinationDirection string `json:"destinationDirection" validate:"required"` DestinationArea string `json:"destinationArea"` DestinationSuburb string `json:"destinationSuburb"` DestinationCity string `json:"destinationCity"` DestinationProvince string `json:"destinationProvince"` DestinationPostCode string `json:"destinationPostcode"` ItemName []ItemName `json:"itemName" validate:"required"` Contents string `json:"contents" validate:"required"` UseInsurance bool `json:"useInsurance"` ExternalID string `json:"externalID"` PaymentType string `json:"paymentType"` PackageType int `json:"packageType" validate:"required"` }
InternationalOrderParams struct contains request parameter for API CreateInternationalOrder.
type LogisticStatusV3 ¶ added in v1.0.0
type PackageDetail ¶ added in v1.0.0
type ShipperStatus ¶ added in v1.0.0
type TrackingsV3 ¶ added in v1.0.0
type TrackingsV3 struct { ShipperStatus ShipperStatus `json:"shipper_status"` LogisticStatus LogisticStatusV3 `json:"logistic_status"` CreatedDate time.Time `json:"created_date"` }
type UpdateOrderParams ¶
type UpdateOrderParams struct { Length float64 `json:"l" validate:"required"` Width float64 `json:"w" validate:"required"` Height float64 `json:"h" validate:"required"` WeightTotal float64 `json:"wt" validate:"required"` }
UpdateOrderParams struct contains request parameter for API UpdateOrder.
type UpdatedOrder ¶
type UpdatedOrder struct { Status string `json:"status"` Data struct { Title string `json:"title"` Content string `json:"content"` CorrectedFields struct { Weight float64 `json:"weight"` VolumeWeight float64 `json:"volumeWeight"` Length float64 `json:"length"` Height float64 `json:"height"` Width float64 `json:"width"` CompulsoryInsurance int `json:"compulsoryInsurance"` Insurance int `json:"insurance"` FinalRate int `json:"finalRate"` } `json:"correctedFields"` StatusCode int `json:"statusCode"` } `json:"data"` }
UpdatedOrder struct contains response from API UpdateOrder.