Documentation ¶
Overview ¶
Package dpd - SDK для интеграции с транспортной компанией DPD
Index ¶
- Constants
- type Address
- func (a *Address) SetAddressString(address string) *Address
- func (a *Address) SetBuilding(building string) *Address
- func (a *Address) SetCity(city string) *Address
- func (a *Address) SetCode(code string) *Address
- func (a *Address) SetContactEmail(email string) *Address
- func (a *Address) SetContactFullName(fullName string) *Address
- func (a *Address) SetContactPhone(phone string) *Address
- func (a *Address) SetCountryName(name string) *Address
- func (a *Address) SetDinnerTimeFrom(start string) *Address
- func (a *Address) SetDinnerTimeTo(end string) *Address
- func (a *Address) SetExtraInfo(info string) *Address
- func (a *Address) SetFlat(flat string) *Address
- func (a *Address) SetHouse(house string) *Address
- func (a *Address) SetHousing(housing string) *Address
- func (a *Address) SetInstructions(instructions string) *Address
- func (a *Address) SetName(name string) *Address
- func (a *Address) SetNeedPass(flag bool) *Address
- func (a *Address) SetOffice(office string) *Address
- func (a *Address) SetPossession(possession string) *Address
- func (a *Address) SetRegion(region string) *Address
- func (a *Address) SetStreet(street string) *Address
- func (a *Address) SetStreetAbbr(abbr string) *Address
- func (a *Address) SetTerminalCode(code string) *Address
- func (a *Address) SetWorkTimeFrom(start string) *Address
- func (a *Address) SetWorkTimeTo(end string) *Address
- func (a *Address) SetZip(zip string) *Address
- type Auth
- type CalculateRequest
- func (r *CalculateRequest) OverrideFrom(city *CityRequest) *CalculateRequest
- func (r *CalculateRequest) OverrideTo(city *CityRequest) *CalculateRequest
- func (r *CalculateRequest) SetDeclaredValue(declaredValue float64) *CalculateRequest
- func (r *CalculateRequest) SetMaxCost(cost float64) *CalculateRequest
- func (r *CalculateRequest) SetMaxDays(days int) *CalculateRequest
- func (r *CalculateRequest) SetPickupDate(time time.Time) *CalculateRequest
- func (r *CalculateRequest) SetSelfDelivery(flag bool) *CalculateRequest
- func (r *CalculateRequest) SetSelfPickup(flag bool) *CalculateRequest
- func (r *CalculateRequest) SetServiceCode(code string) *CalculateRequest
- func (r *CalculateRequest) SetVolume(volume float64) *CalculateRequest
- func (r *CalculateRequest) SetWeight(weight float64) *CalculateRequest
- type CancelOrderRequest
- type City
- type CityRequest
- type Client
- func (cl *Client) AddParcels(req *UpdateOrderRequest) (*OrderCorrectionStatus, error)
- func (cl *Client) CancelOrder(req *CancelOrderRequest) ([]*OrderStatus, error)
- func (cl *Client) CreateOrder(req *CreateOrderRequest) ([]*OrderStatus, error)
- func (cl *Client) GetCitiesCashPay(countryCode string) ([]*City, error)
- func (cl *Client) GetOrderStatus(req []*InternalOrderNumber) ([]*OrderStatus, error)
- func (cl *Client) GetParcelShops(req *ParcelShopRequest) ([]*ParcelShop, error)
- func (cl *Client) GetServiceCost2(req *CalculateRequest) ([]*ServiceCostResponse, error)
- func (cl *Client) GetStatesByClient() (*ParcelsStates, error)
- func (cl *Client) GetStatesByClientOrder(req *TrackByClientOrderRequest) (*ParcelsStates, error)
- func (cl *Client) GetStatesByDPDOrder(req *TrackByDPDOrderRequest) (*ParcelsStates, error)
- func (cl *Client) GetTerminalsSelfDelivery2() ([]*Terminal, error)
- func (cl *Client) RemoveParcels(req *UpdateOrderRequest) (*OrderCorrectionStatus, error)
- type CreateOrderRequest
- func (r *CreateOrderRequest) AddOrder(order *Order) *CreateOrderRequest
- func (r *CreateOrderRequest) SetDatePickup(time time.Time) *CreateOrderRequest
- func (r *CreateOrderRequest) SetPayer(payer int64) *CreateOrderRequest
- func (r *CreateOrderRequest) SetPickupTimePeriod(period string) *CreateOrderRequest
- func (r *CreateOrderRequest) SetRegularNum(num string) *CreateOrderRequest
- func (r *CreateOrderRequest) SetSender(address Address) *CreateOrderRequest
- type DataInternational
- type ExtraParameter
- type ExtraService
- type ExtraServiceParameter
- type ExtraServiceParameters
- type GeoCoordinates
- type GeographyAddress
- type GetCitiesCashPayResponse
- type Header
- type InternalOrderNumber
- type Limits
- type Order
- func (o *Order) AddExtraParameter(parameter *ExtraParameter) *Order
- func (o *Order) AddExtraService(service *ExtraService) *Order
- func (o *Order) AddParcel(parcel *Parcel) *Order
- func (o *Order) AddUnitLoad(load *UnitLoadOrder) *Order
- func (o *Order) SetCargoCategory(category string) *Order
- func (o *Order) SetCargoCount(num int) *Order
- func (o *Order) SetCargoValue(value float64) *Order
- func (o *Order) SetCargoVolume(volume float64) *Order
- func (o *Order) SetCargoWeight(weight float64) *Order
- func (o *Order) SetDeliveryTimePeriod(period string) *Order
- func (o *Order) SetInternalOrderNumber(number string) *Order
- func (o *Order) SetPaymentType(pType string) *Order
- func (o *Order) SetReceiverAddress(address *Address) *Order
- func (o *Order) SetReturnAddress(address *Address) *Order
- func (o *Order) SetServiceCode(code string) *Order
- func (o *Order) SetServiceVariant(variant string) *Order
- func (o *Order) SetValuableCargo(flag bool) *Order
- type OrderCorrectionStatus
- type OrderStatus
- type OrderToCancel
- type Parcel
- func (p *Parcel) SetBoxNeeded(needed int) *Parcel
- func (p *Parcel) SetCodAmount(amount float64) *Parcel
- func (p *Parcel) SetDPDParcelNumber(number int64) *Parcel
- func (p *Parcel) SetHeight(height float64) *Parcel
- func (p *Parcel) SetInsuranceCost(cost float64) *Parcel
- func (p *Parcel) SetLength(length float64) *Parcel
- func (p *Parcel) SetNumber(number string) *Parcel
- func (p *Parcel) SetNumberForPrint(number string) *Parcel
- func (p *Parcel) SetWeight(weight float64) *Parcel
- func (p *Parcel) SetWidth(width float64) *Parcel
- type ParcelShop
- type ParcelShopRequest
- type ParcelState
- type ParcelStatus
- type ParcelsStates
- type Schedule
- type ServiceCostResponse
- type ServiceUrls
- type Terminal
- type Terminals
- type Timetable
- type TrackByClientOrderRequest
- type TrackByDPDOrderRequest
- type UnitLoadOrder
- type UpdateOrderRequest
- func (r *UpdateOrderRequest) AddParcel(parcel *Parcel) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetCargoCategory(category string) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetCargoNumPack(num int) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetCargoValue(value float64) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetCargoVolume(volume float64) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetCargoWeight(weight float64) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetDPDOrderNumber(number string) *UpdateOrderRequest
- func (r *UpdateOrderRequest) SetInternalOrderNumber(number string) *UpdateOrderRequest
Examples ¶
Constants ¶
const (
//CityCODPaymentLimit represents default C.O.D. payment limit for all dpd cities in which C.O.D. is available
CityCODPaymentLimit = 250000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Code *string `xml:"code,omitempty"` Name *string `xml:"name,omitempty"` TerminalCode *string `xml:"terminalCode,omitempty"` AddressString *string `xml:"addressString,omitempty"` CountryName *string `xml:"countryName,omitempty"` Index *string `xml:"index,omitempty"` Region *string `xml:"region,omitempty"` City *string `xml:"city,omitempty"` Street *string `xml:"street,omitempty"` StreetAbbr *string `xml:"streetAbbr,omitempty"` House *string `xml:"house,omitempty"` HouseKorpus *string `xml:"houseKorpus,omitempty"` Str *string `xml:"str,omitempty"` Vlad *string `xml:"vlad,omitempty"` ExtraInfo *string `xml:"extraInfo,omitempty"` Office *string `xml:"office,omitempty"` Flat *string `xml:"flat,omitempty"` WorkTimeFrom *string `xml:"workTimeFrom,omitempty"` WorkTimeTo *string `xml:"workTimeTo,omitempty"` DinnerTimeFrom *string `xml:"dinnerTimeFrom,omitempty"` DinnerTimeTo *string `xml:"dinnerTimeTo,omitempty"` ContactFio *string `xml:"contactFio,omitempty"` ContactPhone *string `xml:"contactPhone,omitempty"` ContactEmail *string `xml:"contactEmail,omitempty"` Instructions *string `xml:"instructions,omitempty"` NeedPass *bool `xml:"needPass,omitempty"` }
Address ...
func NewAddress ¶
func NewAddress() *Address
func (*Address) SetAddressString ¶
func (*Address) SetBuilding ¶
func (*Address) SetContactEmail ¶
func (*Address) SetContactFullName ¶
func (*Address) SetContactPhone ¶
func (*Address) SetCountryName ¶
func (*Address) SetDinnerTimeFrom ¶
func (*Address) SetDinnerTimeTo ¶
func (*Address) SetExtraInfo ¶
func (*Address) SetHousing ¶
func (*Address) SetInstructions ¶
func (*Address) SetNeedPass ¶
func (*Address) SetPossession ¶
func (*Address) SetStreetAbbr ¶
func (*Address) SetTerminalCode ¶
func (*Address) SetWorkTimeFrom ¶
func (*Address) SetWorkTimeTo ¶
type Auth ¶
type Auth struct { Namespace *string `xml:"xmlns,attr"` ClientNumber *int64 `xml:"clientNumber,omitempty"` ClientKey *string `xml:"clientKey,omitempty"` }
Auth part of all requests. Credentials to DPD SOAP API
type CalculateRequest ¶
type CalculateRequest struct { Namespace string `xml:"xmlns,attr"` Auth *Auth `xml:"auth,omitempty"` Pickup *CityRequest `xml:"pickup,omitempty"` Delivery *CityRequest `xml:"delivery,omitempty"` SelfPickup *bool `xml:"selfPickup,omitempty"` SelfDelivery *bool `xml:"selfDelivery,omitempty"` Weight *float64 `xml:"weight,omitempty"` Volume *float64 `xml:"volume,omitempty"` ServiceCode *string `xml:"serviceCode,omitempty"` PickupDate *string `xml:"pickupDate,omitempty"` MaxDays *int `xml:"maxDays,omitempty"` MaxCost *float64 `xml:"maxCost,omitempty"` DeclaredValue *float64 `xml:"declaredValue,omitempty"` }
CalculateRequest GetServiceCost2 request body
func NewCalculateRequest ¶
func NewCalculateRequest(from, to *CityRequest, weight float64, selfPickup, selfDelivery bool) *CalculateRequest
NewCalculateRequest creates new pointer to CalculateRequest with required parameters
func (*CalculateRequest) OverrideFrom ¶
func (r *CalculateRequest) OverrideFrom(city *CityRequest) *CalculateRequest
OverrideFrom overrides pickup (city-sender) field in CalculateRequest struct
func (*CalculateRequest) OverrideTo ¶
func (r *CalculateRequest) OverrideTo(city *CityRequest) *CalculateRequest
OverrideTo overrides delivery (city-recipient) field in CalculateRequest struct
func (*CalculateRequest) SetDeclaredValue ¶
func (r *CalculateRequest) SetDeclaredValue(declaredValue float64) *CalculateRequest
SetDeclaredValue set cargo declared value
func (*CalculateRequest) SetMaxCost ¶
func (r *CalculateRequest) SetMaxCost(cost float64) *CalculateRequest
SetMaxCost If specific service is set up for request, call of this function with any parameter has not affect result of request
func (*CalculateRequest) SetMaxDays ¶
func (r *CalculateRequest) SetMaxDays(days int) *CalculateRequest
SetMaxDays If specific service is set up for request, call of this function with any parameter has not affect result of request
func (*CalculateRequest) SetPickupDate ¶
func (r *CalculateRequest) SetPickupDate(time time.Time) *CalculateRequest
SetPickupDate set date of parcel pickup& If not set DPD use current date by default
func (*CalculateRequest) SetSelfDelivery ¶
func (r *CalculateRequest) SetSelfDelivery(flag bool) *CalculateRequest
SetSelfDelivery set DPD-side delivery to their terminal and customer-side pickup on DPD terminal
func (*CalculateRequest) SetSelfPickup ¶
func (r *CalculateRequest) SetSelfPickup(flag bool) *CalculateRequest
SetSelfPickup set client-side delivery to DPD terminal
func (*CalculateRequest) SetServiceCode ¶
func (r *CalculateRequest) SetServiceCode(code string) *CalculateRequest
SetServiceCode set service codes - list of comma-separated values If set, DPD service will return cost only for given service codes
func (*CalculateRequest) SetVolume ¶
func (r *CalculateRequest) SetVolume(volume float64) *CalculateRequest
SetVolume set volume of parcel
func (*CalculateRequest) SetWeight ¶
func (r *CalculateRequest) SetWeight(weight float64) *CalculateRequest
SetWeight set weight of parcel
type CancelOrderRequest ¶
type CancelOrderRequest struct { Auth *Auth `xml:"auth,omitempty"` Cancel []*OrderToCancel `xml:"cancel,omitempty"` }
CancelOrderRequest CancelOrder request body
func NewCancelOrderRequest ¶
func NewCancelOrderRequest() *CancelOrderRequest
func (*CancelOrderRequest) AddOrder ¶
func (r *CancelOrderRequest) AddOrder(order *OrderToCancel) *CancelOrderRequest
type City ¶
type City struct { CityID *int64 `xml:"cityId,omitempty"` CountryCode *string `xml:"countryCode,omitempty"` CountryName *string `xml:"countryName,omitempty"` RegionCode *int `xml:"regionCode,omitempty"` RegionName *string `xml:"regionName,omitempty"` CityCode *string `xml:"cityCode,omitempty"` CityName *string `xml:"cityName,omitempty"` Abbreviation *string `xml:"abbreviation,omitempty"` IndexMin *string `xml:"indexMin,omitempty"` IndexMax *string `xml:"indexMax,omitempty"` }
City with C.O.D available
type CityRequest ¶
type CityRequest struct { CityID *int64 `xml:"cityId,omitempty"` Index *string `xml:"index,omitempty"` CityName *string `xml:"cityName,omitempty"` RegionCode *int `xml:"regionCode,omitempty"` CountryCode *string `xml:"countryCode,omitempty"` }
CityRequest Pickup and Delivery part of CalculateRequest
func NewCity ¶
func NewCity(cityID int64) *CityRequest
NewCity creates new pointer to CityRequest use by CalculateRequest
func (*CityRequest) SetCityName ¶
func (c *CityRequest) SetCityName(name string) *CityRequest
SetCityName set city name for city request
func (*CityRequest) SetCountryCode ¶
func (c *CityRequest) SetCountryCode(code string) *CityRequest
SetCountryCode the code must comply with ISO 3166-1 alpha-2 If omitted, default RU
func (*CityRequest) SetIndex ¶
func (c *CityRequest) SetIndex(index string) *CityRequest
SetIndex set zip code of city
func (*CityRequest) SetRegionCode ¶
func (c *CityRequest) SetRegionCode(code int) *CityRequest
SetRegionCode set region code for city request
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for DPD soap api
func NewClient ¶
func NewClient(clientNumber int64, clientKey string, urls ServiceUrls) *Client
NewClient creates new client
Example ¶
NewClient(anyNumber, anyKey, ServiceUrls{ CalculatorURL: "", OrderURL: "", GeographyURL: "", TrackingURL: "", })
Output:
func (*Client) AddParcels ¶
func (cl *Client) AddParcels(req *UpdateOrderRequest) (*OrderCorrectionStatus, error)
AddParcels change order with parcel addition
func (*Client) CancelOrder ¶
func (cl *Client) CancelOrder(req *CancelOrderRequest) ([]*OrderStatus, error)
CancelOrder cancel a delivery order
func (*Client) CreateOrder ¶
func (cl *Client) CreateOrder(req *CreateOrderRequest) ([]*OrderStatus, error)
CreateOrder create a delivery order
func (*Client) GetCitiesCashPay ¶
GetCitiesCashPay countryCode must comply with ISO 3166-1 alpha-2
Example ¶
client := NewClient(0, "", ServiceUrls{}) cities, err := client.GetCitiesCashPay("RU") if err != nil { log.Fatalf("Error occurred %s", err.Error()) } for _, value := range cities { fmt.Println(*value.CityName) }
Output:
func (*Client) GetOrderStatus ¶
func (cl *Client) GetOrderStatus(req []*InternalOrderNumber) ([]*OrderStatus, error)
GetOrderStatus returns order creation status
func (*Client) GetParcelShops ¶
func (cl *Client) GetParcelShops(req *ParcelShopRequest) ([]*ParcelShop, error)
GetParcelShops return list of pickup/delivery points with restrictions about weight and dimensions
Example ¶
client := NewClient(0, "", ServiceUrls{}) req := NewParcelShopRequest() //For retrieving all points req.SetCountryCode("RU") //For retrieving points in specific city req.SetCountryCode("RU"). SetCityCode("1243124") //DPD native, city identifier shops, err := client.GetParcelShops(req) if err != nil { log.Fatalf("Error occurred %s", err.Error()) } for _, value := range shops { fmt.Printf("Shop: %s", *value.Brand) }
Output:
func (*Client) GetServiceCost2 ¶
func (cl *Client) GetServiceCost2(req *CalculateRequest) ([]*ServiceCostResponse, error)
GetServiceCost2 return cost of delivery for Russia and Customs Union
Example ¶
client := NewClient(0, "", ServiceUrls{}) req := NewCalculateRequest( NewCity(123).SetCityName("Анапа"), NewCity(321).SetCityName("Апана"), 1.89, false, false) offers, err := client.GetServiceCost2(req) if err != nil { log.Fatalf("Error occurred %s", err.Error()) } for _, value := range offers { fmt.Printf("Delivery cost: %b", *value.Cost) }
Output:
func (*Client) GetStatesByClient ¶
func (cl *Client) GetStatesByClient() (*ParcelsStates, error)
GetStatesByClient returns all statuses of client parcels since previous method call
func (*Client) GetStatesByClientOrder ¶
func (cl *Client) GetStatesByClientOrder(req *TrackByClientOrderRequest) (*ParcelsStates, error)
GetStatesByClientOrder returns list of states for all parcels for specified order Order identify by client side order number
func (*Client) GetStatesByDPDOrder ¶
func (cl *Client) GetStatesByDPDOrder(req *TrackByDPDOrderRequest) (*ParcelsStates, error)
GetStatesByDPDOrder returns states history for specified parcel Parcel identify by client side parcel number
func (*Client) GetTerminalsSelfDelivery2 ¶
GetTerminalsSelfDelivery2 return terminals list. They don't have any restrictions
func (*Client) RemoveParcels ¶
func (cl *Client) RemoveParcels(req *UpdateOrderRequest) (*OrderCorrectionStatus, error)
RemoveParcels change order with parcel deletion
type CreateOrderRequest ¶
type CreateOrderRequest struct { Namespace string `xml:"xmlns,attr"` Auth *Auth `xml:"auth,omitempty"` Header *Header `xml:"header,omitempty"` Order []*Order `xml:"order,omitempty"` }
CreateOrderRequest CreateOrder request body
func NewCreateOrderRequest ¶
func NewCreateOrderRequest() *CreateOrderRequest
NewCreateOrderRequest ...
func (*CreateOrderRequest) AddOrder ¶
func (r *CreateOrderRequest) AddOrder(order *Order) *CreateOrderRequest
AddOrder to CreateOrderRequest
func (*CreateOrderRequest) SetDatePickup ¶
func (r *CreateOrderRequest) SetDatePickup(time time.Time) *CreateOrderRequest
SetDatePickup ...
func (*CreateOrderRequest) SetPayer ¶
func (r *CreateOrderRequest) SetPayer(payer int64) *CreateOrderRequest
SetPayer ...
func (*CreateOrderRequest) SetPickupTimePeriod ¶
func (r *CreateOrderRequest) SetPickupTimePeriod(period string) *CreateOrderRequest
SetPickupTimePeriod ...
func (*CreateOrderRequest) SetRegularNum ¶
func (r *CreateOrderRequest) SetRegularNum(num string) *CreateOrderRequest
SetRegularNum regular DPD order number. Ask your manager about correct number if you use it
func (*CreateOrderRequest) SetSender ¶
func (r *CreateOrderRequest) SetSender(address Address) *CreateOrderRequest
SetSender ...
type DataInternational ¶
type DataInternational struct { Currency *string `xml:"currency,omitempty"` CurrencyDeclaredValue *string `xml:"currencyDeclaredValue,omitempty"` }
DataInternational data for international delivery orders
type ExtraParameter ¶
type ExtraParameter struct { Name *string `xml:"name,omitempty"` Value *string `xml:"value,omitempty"` }
ExtraParameter delivery option
type ExtraService ¶
type ExtraService struct { EsCode *string `xml:"esCode,omitempty"` Param []*ExtraParameter `xml:"param,omitempty"` }
ExtraService list of delivery options
type ExtraServiceParameter ¶
type ExtraServiceParameter struct { Name *string `xml:"name,omitempty"` Value *string `xml:"value,omitempty"` }
ExtraServiceParameter ...
type ExtraServiceParameters ¶
type ExtraServiceParameters struct { EsCode *string `xml:"esCode,omitempty"` Params []*ExtraServiceParameter `xml:"params,omitempty"` }
ExtraServiceParameters for ParcelShop or Terminal
type GeoCoordinates ¶
type GeoCoordinates struct { Latitude *float64 `xml:"latitude,omitempty"` Longitude *float64 `xml:"longitude,omitempty"` }
GeoCoordinates of ParcelShop or Terminal
type GeographyAddress ¶
type GeographyAddress struct { CityID *int64 `xml:"cityId,omitempty"` CountryCode *string `xml:"countryCode,omitempty"` RegionCode *string `xml:"regionCode,omitempty"` RegionName *string `xml:"regionName,omitempty"` CityCode *string `xml:"cityCode,omitempty"` CityName *string `xml:"cityName,omitempty"` Index *string `xml:"index,omitempty"` Street *string `xml:"street,omitempty"` StreetAbbr *string `xml:"streetAbbr,omitempty"` HouseNo *string `xml:"houseNo,omitempty"` Building *string `xml:"building,omitempty"` Structure *string `xml:"structure,omitempty"` Ownership *string `xml:"ownership,omitempty"` Description *string `xml:"descript,omitempty"` }
GeographyAddress of ParcelShop or Terminal
type GetCitiesCashPayResponse ¶
type GetCitiesCashPayResponse struct {
Return []*City `xml:"return,omitempty"`
}
GetCitiesCashPayResponse list of DPD cities with C.O.D available
type Header ¶
type Header struct { DatePickup *string `xml:"datePickup,omitempty"` Payer *int64 `xml:"payer,omitempty"` SenderAddress *Address `xml:"senderAddress,omitempty"` PickupTimePeriod *string `xml:"pickupTimePeriod,omitempty"` RegularNum *string `xml:"regularNum,omitempty"` }
Header common for all types of orders. Contains information about sender
type InternalOrderNumber ¶
type InternalOrderNumber struct { OrderNumberInternal *string `xml:"orderNumberInternal,omitempty"` DatePickup *string `xml:"datePickup,omitempty"` }
InternalOrderNumber GetOrderStatus request body. Imply client side oder number
type Limits ¶
type Limits struct { MaxShipmentWeight *float64 `xml:"maxShipmentWeight,omitempty"` MaxWeight *float64 `xml:"maxWeight,omitempty"` MaxLength *float64 `xml:"maxLength,omitempty"` MaxWidth *float64 `xml:"maxWidth,omitempty"` MaxHeight *float64 `xml:"maxHeight,omitempty"` DimensionSum *float64 `xml:"dimensionSum,omitempty"` }
Limits of ParcelShop
type Order ¶
type Order struct { OrderNumberInternal *string `xml:"orderNumberInternal,omitempty"` ServiceCode *string `xml:"serviceCode,omitempty"` ServiceVariant *string `xml:"serviceVariant,omitempty"` CargoNumPack *int `xml:"cargoNumPack,omitempty"` CargoWeight *float64 `xml:"cargoWeight,omitempty"` CargoVolume *float64 `xml:"cargoVolume,omitempty"` CargoRegistered *bool `xml:"cargoRegistered,omitempty"` CargoValue *float64 `xml:"cargoValue,omitempty"` CargoCategory *string `xml:"cargoCategory,omitempty"` DeliveryTimePeriod *string `xml:"deliveryTimePeriod,omitempty"` PaymentType *string `xml:"paymentType,omitempty"` ExtraParam []*ExtraParameter `xml:"extraParam,omitempty"` DataInt *DataInternational `xml:"dataInt,omitempty"` ReceiverAddress *Address `xml:"receiverAddress,omitempty"` ReturnAddress *Address `xml:"returnAddress,omitempty"` ExtraService []*ExtraService `xml:"extraService,omitempty"` Parcel []*Parcel `xml:"parcel,omitempty"` UnitLoad []*UnitLoadOrder `xml:"unitLoad,omitempty"` }
Order to creation
func (*Order) AddExtraParameter ¶
func (o *Order) AddExtraParameter(parameter *ExtraParameter) *Order
func (*Order) AddExtraService ¶
func (o *Order) AddExtraService(service *ExtraService) *Order
func (*Order) AddUnitLoad ¶
func (o *Order) AddUnitLoad(load *UnitLoadOrder) *Order
func (*Order) SetCargoCategory ¶ added in v0.1.3
SetCargoCategory ...
func (*Order) SetCargoVolume ¶
SetCargoVolume ...
func (*Order) SetCargoWeight ¶
SetCargoWeight ...
func (*Order) SetDeliveryTimePeriod ¶
func (*Order) SetInternalOrderNumber ¶
SetInternalOrderNumber imply client side order number
func (*Order) SetPaymentType ¶
func (*Order) SetReceiverAddress ¶
func (*Order) SetReturnAddress ¶
func (*Order) SetServiceCode ¶
SetServiceCode code of DPD service
func (*Order) SetServiceVariant ¶
SetServiceVariant delivery variant& Four variants are available(ДД, ДТ, ТД, ТТ)
func (*Order) SetValuableCargo ¶
SetValuableCargo ...
type OrderCorrectionStatus ¶
type OrderCorrectionStatus struct { OrderNum *string `xml:"orderNum,omitempty"` Status *string `xml:"status,omitempty"` ErrorMessage *string `xml:"errorMessage,omitempty"` ParcelStatus []*ParcelStatus `xml:"parcelStatus,omitempty"` }
OrderCorrectionStatus AddParcels\RemoveParcels response body
type OrderStatus ¶
type OrderStatus struct { OrderNumberInternal *string `xml:"orderNumberInternal,omitempty"` OrderNum *string `xml:"orderNum,omitempty"` Status *string `xml:"status,omitempty"` ErrorMessage *string `xml:"errorMessage,omitempty"` }
OrderStatus CancelOrder response item
type OrderToCancel ¶
type OrderToCancel struct { OrderNumberInternal *string `xml:"orderNumberInternal,omitempty"` OrderNum *string `xml:"orderNum,omitempty"` PickupDate *string `xml:"pickupdate,omitempty"` }
OrderToCancel ...
func NewOrderToCancel ¶
func NewOrderToCancel() *OrderToCancel
func (*OrderToCancel) SetDPDOrderNumber ¶
func (o *OrderToCancel) SetDPDOrderNumber(number string) *OrderToCancel
func (*OrderToCancel) SetInternalOrderNumber ¶
func (o *OrderToCancel) SetInternalOrderNumber(number string) *OrderToCancel
func (*OrderToCancel) SetPickupDate ¶
func (o *OrderToCancel) SetPickupDate(time time.Time) *OrderToCancel
type Parcel ¶
type Parcel struct { Number *string `xml:"number,omitempty"` DpdParcelNumber *int64 `xml:"dpdParcelNumber,omitempty"` NumberForPrint *string `xml:"number_for_print,omitempty"` BoxNeeded *int `xml:"box_needed,omitempty"` Weight *float64 `xml:"weight,omitempty"` Length *float64 `xml:"length,omitempty"` Width *float64 `xml:"width,omitempty"` Height *float64 `xml:"height,omitempty"` InsuranceCost *float64 `xml:"insuranceCost,omitempty"` InsuranceCostVat *float64 `xml:"insuranceCostVat,omitempty"` CodAmount *float64 `xml:"codAmount,omitempty"` }
Parcel to add or remove
func (*Parcel) SetBoxNeeded ¶
func (*Parcel) SetCodAmount ¶
func (*Parcel) SetDPDParcelNumber ¶
func (*Parcel) SetInsuranceCost ¶
func (*Parcel) SetNumberForPrint ¶
type ParcelShop ¶
type ParcelShop struct { Code *string `xml:"code,omitempty"` ParcelShopType *string `xml:"parcelShopType,omitempty"` State *string `xml:"state,omitempty"` Address *GeographyAddress `xml:"address,omitempty"` Brand *string `xml:"brand,omitempty"` ClientDepartmentNum *string `xml:"clientDepartmentNum,omitempty"` GeoCoordinates *GeoCoordinates `xml:"geoCoordinates,omitempty"` Limits *Limits `xml:"limits,omitempty"` Schedule []*Schedule `xml:"schedule,omitempty"` ExtraService []*ExtraServiceParameters `xml:"extraService,omitempty"` Services []*string `xml:"services>serviceCode,omitempty"` }
ParcelShop self delivery point with limits on dimensions and weight
type ParcelShopRequest ¶
type ParcelShopRequest struct { Namespace string `xml:"xmlns,attr"` Auth *Auth `xml:"auth,omitempty"` CountryCode *string `xml:"countryCode,omitempty"` RegionCode *string `xml:"regionCode,omitempty"` CityCode *string `xml:"cityCode,omitempty"` CityName *string `xml:"cityName,omitempty"` }
ParcelShopRequest GetParcelShops request body
func NewParcelShopRequest ¶
func NewParcelShopRequest() *ParcelShopRequest
NewParcelShopRequest returns pointer to ParcelShopRequest
func (*ParcelShopRequest) SetCityCode ¶
func (r *ParcelShopRequest) SetCityCode(code string) *ParcelShopRequest
SetCityCode parameter must comply DPD native city code
func (*ParcelShopRequest) SetCityName ¶
func (r *ParcelShopRequest) SetCityName(name string) *ParcelShopRequest
SetCityName ...
func (*ParcelShopRequest) SetCountryCode ¶
func (r *ParcelShopRequest) SetCountryCode(code string) *ParcelShopRequest
SetCountryCode the code must comply with ISO 3166-1 alpha-2 If omitted, default RU
func (*ParcelShopRequest) SetRegionCode ¶
func (r *ParcelShopRequest) SetRegionCode(code string) *ParcelShopRequest
SetRegionCode parameter must comply DPD native region code
type ParcelState ¶
type ParcelState struct { ClientOrderNr *string `xml:"clientOrderNr,omitempty"` ClientParcelNr *string `xml:"clientParcelNr,omitempty"` DpdOrderNr *string `xml:"dpdOrderNr,omitempty"` DpdParcelNr *string `xml:"dpdParcelNr,omitempty"` PickupDate *string `xml:"pickupDate,omitempty"` DpdOrderReNr *string `xml:"dpdOrderReNr,omitempty"` DpdParcelReNr *string `xml:"dpdParcelReNr,omitempty"` IsReturn *bool `xml:"isReturn,omitempty"` PlanDeliveryDate *string `xml:"planDeliveryDate,omitempty"` NewState *string `xml:"newState,omitempty"` TransitionTime *string `xml:"transitionTime,omitempty"` TerminalCode *string `xml:"terminalCode,omitempty"` TerminalCity *string `xml:"terminalCity,omitempty"` IncidentCode *string `xml:"incidentCode,omitempty"` IncidentName *string `xml:"incidentName,omitempty"` Consignee *string `xml:"consignee,omitempty"` }
type ParcelStatus ¶
type ParcelStatus struct { Number *string `xml:"number,omitempty"` Status *string `xml:"status,omitempty"` ErrorMessage *string `xml:"errorMessage,omitempty"` }
ParcelsStatus correction status
type ParcelsStates ¶
type ParcelsStates struct { DocID *int64 `xml:"docId,omitempty"` DocDate *string `xml:"docDate,omitempty"` ClientNumber *int64 `xml:"clientNumber,omitempty"` ResultComplete *bool `xml:"resultComplete,omitempty"` States []*ParcelState `xml:"states,omitempty"` }
type Schedule ¶
type Schedule struct { Operation *string `xml:"operation,omitempty"` Timetable []*Timetable `xml:"timetable,omitempty"` }
Schedule of ParcelShop or Terminal
type ServiceCostResponse ¶
type ServiceCostResponse struct { ServiceCode *string `xml:"serviceCode,omitempty"` ServiceName *string `xml:"serviceName,omitempty"` Cost *float64 `xml:"cost,omitempty"` Days *int `xml:"days,omitempty"` }
ServiceCostResponse GetServiceCost2 return body
type ServiceUrls ¶
type ServiceUrls struct { CalculatorURL string GeographyURL string OrderURL string TrackingURL string }
ServiceUrls DPD services urls
type Terminal ¶
type Terminal struct { TerminalCode *string `xml:"terminalCode,omitempty"` TerminalName *string `xml:"terminalName,omitempty"` Address *GeographyAddress `xml:"address,omitempty"` GeoCoordinates *GeoCoordinates `xml:"geoCoordinates,omitempty"` Schedule []*Schedule `xml:"schedule,omitempty"` ExtraService []*ExtraServiceParameters `xml:"extraService,omitempty"` Services []*string `xml:"services>serviceCode,omitempty"` }
Terminal ...
type Terminals ¶
type Terminals struct {
Terminal []*Terminal `xml:"terminal,omitempty"`
}
Terminals GetTerminalsSelfDelivery2 response body
type Timetable ¶
type Timetable struct { WeekDays *string `xml:"weekDays,omitempty"` WorkTime *string `xml:"workTime,omitempty"` }
Timetable for operations
type TrackByClientOrderRequest ¶
type TrackByClientOrderRequest struct { Auth *Auth `xml:"auth,omitempty"` ClientOrderNr *string `xml:"clientOrderNr,omitempty"` PickupDate *string `xml:"pickupDate,omitempty"` }
TrackByClientOrderRequest GetStatesByClientOrder request body
func NewClientOrderRequest ¶
func NewClientOrderRequest() *TrackByClientOrderRequest
func (*TrackByClientOrderRequest) SetClientOrderNumber ¶
func (r *TrackByClientOrderRequest) SetClientOrderNumber(number string) *TrackByClientOrderRequest
func (*TrackByClientOrderRequest) SetPickupDate ¶
func (r *TrackByClientOrderRequest) SetPickupDate(time time.Time) *TrackByClientOrderRequest
type TrackByDPDOrderRequest ¶
type TrackByDPDOrderRequest struct { Namespace string `xml:"xmlns,attr"` Auth *Auth `xml:"auth,omitempty"` DpdOrderNr *string `xml:"dpdOrderNr,omitempty"` PickupYear *int `xml:"pickupYear,omitempty"` }
TrackByDPDOrderRequest GetStatesByDPDOrder request body
func NewDpdOrderRequest ¶
func NewDpdOrderRequest() *TrackByDPDOrderRequest
func (*TrackByDPDOrderRequest) SetDPDOrderNumber ¶
func (r *TrackByDPDOrderRequest) SetDPDOrderNumber(number string) *TrackByDPDOrderRequest
func (*TrackByDPDOrderRequest) SetPickupYear ¶
func (r *TrackByDPDOrderRequest) SetPickupYear(year int) *TrackByDPDOrderRequest
type UnitLoadOrder ¶
type UnitLoadOrder struct { ClientCode *string `xml:"client_code,omitempty"` // contains filtered or unexported fields }
UnitLoadOrder array of units in cargo for 54 federal law (54-ФЗ)
type UpdateOrderRequest ¶
type UpdateOrderRequest struct { Auth *Auth `xml:"auth,omitempty"` OrderNum *string `xml:"orderNum,omitempty"` OrderNumberInternal *string `xml:"orderNumberInternal,omitempty"` CargoNumPack *int `xml:"cargoNumPack,omitempty"` CargoWeight *float64 `xml:"cargoWeight,omitempty"` CargoVolume *float64 `xml:"cargoVolume,omitempty"` CargoValue *float64 `xml:"cargoValue,omitempty"` CargoCategory *string `xml:"cargoCategory,omitempty"` Parcel []*Parcel `xml:"parcel,omitempty"` }
UpdateOrderRequest AddParcels\RemoveParcels request body
func NewUpdateOrderRequest ¶
func NewUpdateOrderRequest() *UpdateOrderRequest
func (*UpdateOrderRequest) AddParcel ¶
func (r *UpdateOrderRequest) AddParcel(parcel *Parcel) *UpdateOrderRequest
func (*UpdateOrderRequest) SetCargoCategory ¶
func (r *UpdateOrderRequest) SetCargoCategory(category string) *UpdateOrderRequest
func (*UpdateOrderRequest) SetCargoNumPack ¶
func (r *UpdateOrderRequest) SetCargoNumPack(num int) *UpdateOrderRequest
func (*UpdateOrderRequest) SetCargoValue ¶
func (r *UpdateOrderRequest) SetCargoValue(value float64) *UpdateOrderRequest
func (*UpdateOrderRequest) SetCargoVolume ¶
func (r *UpdateOrderRequest) SetCargoVolume(volume float64) *UpdateOrderRequest
func (*UpdateOrderRequest) SetCargoWeight ¶
func (r *UpdateOrderRequest) SetCargoWeight(weight float64) *UpdateOrderRequest
func (*UpdateOrderRequest) SetDPDOrderNumber ¶
func (r *UpdateOrderRequest) SetDPDOrderNumber(number string) *UpdateOrderRequest
func (*UpdateOrderRequest) SetInternalOrderNumber ¶
func (r *UpdateOrderRequest) SetInternalOrderNumber(number string) *UpdateOrderRequest