package order import ( "git.oa00.com/go/jcook-sdk/api/rest" ) // SubmitOrderRequest 提交order. type SubmitOrderRequest struct { CtpProtocol rest.CtpProtocol `json:"protocol"` OrderParam Param `json:"param"` } type Param struct { ChannelOrderID string `json:"channelOrderId"` Pin string `json:"pin"` ProductList []ProductParam `json:"productList"` OrderFee float64 `json:"orderFee"` FreightFee float64 `json:"freightFee"` Address rest.Address `json:"address"` Receiver ReceiverParam `json:"receiver"` PaymentType uint `json:"paymentType"` ShipmentType ShipmentType `json:"ShipmentType"` ChannelOrderSource string `json:"channelOrderSource"` SendGoods uint `json:"sendGoods"` Invoice InvoiceParam `json:"invoice"` UserIp string `json:"userIp"` } type ProductParam struct { MainSku rest.SkuParam `json:"mainSku"` } type ReceiverParam struct { ReceiverName string `json:"receiverName"` ReceiverMobile string `json:"receiverMobile"` ReceiverEmail string `json:"receiverEmail"` ZipCode string `json:"zipCode"` } type VatAddressParam struct { VatProvinceID uint `json:"vatProvinceId"` VatCityID uint `json:"vatCityId"` VatCountyID uint `json:"vatCountyId"` VatTownID uint `json:"vatTownId"` VatFullAddress string `json:"vatFullAddress"` } type VatInvoiceParam struct { CompanyName string `json:"companyName"` Code string `json:"code"` RegAddr string `json:"regAddr"` RegPhone string `json:"regPhone"` RegBank string `json:"regBank"` RegBankAccount string `json:"regBankAccount"` ConsigneeName string `json:"consigneeName"` ConsigneeMobile string `json:"consigneeMobile"` VatAddress VatAddressParam `json:"vatAddress"` } type ElectronicInvoiceParam struct { SelectedInvoiceTitle string `json:"selectedInvoiceTitle"` ElectCompanyName string `json:"electCompanyName"` ElectCode string `json:"electCode"` InvoiceConsigneeEmail string `json:"invoiceConsigneeEmail"` InvoiceConsigneePhone string `json:"invoiceConsigneePhone"` } type InvoiceParam struct { InvoiceType uint `json:"invoiceType"` VatInvoice VatInvoiceParam `json:"vatInvoice"` //ElectronicInvoice ElectronicInvoiceParam `json:"electronicInvoice"` } func (o SubmitOrderRequest) GetApiName() string { return "jingdong.ctp.order.submitOrder" } func (o SubmitOrderRequest) GetRespName() string { return "jingdong_ctp_order_submitOrder_responce" } func (o SubmitOrderRequest) GetRespObj() interface{} { return SubmitOrderResponse{} } //SubmitOrderResponse 提交订单返回. type SubmitOrderResponse struct { Result struct { ErrCode uint `json:"errCode"` ErrMsg string `json:"errMsg"` Success bool `json:"success"` Data SubmitOrderParam `json:"data"` SubErrCode string `json:"subErrCode"` SubErrMsg string `json:"subErrMsg"` } `json:"result"` } type SubmitOrderParam struct { ChannelID uint `json:"channelId"` ChannelOrderID string `json:"channelOrderId"` OrderID uint `json:"orderId"` }