Documentation
¶
Index ¶
- Constants
- Variables
- type AddedService
- type Body
- type Config
- func (c *Config) Order(order Order) (*OrderResponse, error)
- func (c *Config) OrderConfirm(orderConfirm OrderConfirm) (*OrderConfirmResponse, error)
- func (c *Config) OrderFilterService(orderFilter OrderFilter) (*OrderFilterResponse, error)
- func (c *Config) OrderQuery(orderSearch OrderSearch) (*OrderResponse, error)
- func (c *Config) OrderRouteService(routeRequest RouteRequest) ([]RouteResponse, error)
- type Err
- type ErrCode
- type ErrMsg
- type ExpressTypeCode
- type Head
- type Order
- type OrderConfirm
- type OrderConfirmRequestBody
- type OrderConfirmResponse
- type OrderConfirmResponseBody
- type OrderFilter
- type OrderFilterRequestBody
- type OrderFilterResponse
- type OrderFilterResponseBody
- type OrderRequestBody
- type OrderResponse
- type OrderResponseBody
- type OrderSearch
- type OrderSearchRequestBody
- type OrderSearchResponseBody
- type RequestXml
- type ResponseBody
- type ResponseXml
- type Route
- type RouteRequest
- type RouteRequestBody
- type RouteResponse
- type RouteResponseBody
- type ServiceName
- type UserInfo
Constants ¶
View Source
const ( HeadSuccess Head = "OK" //交易成功 HeadERR Head = "ERR" //系统或业务异常,交易失败 ErrCodeAddrRequired ErrCode = "010" //寄件地址不能为空 ErrCodeContractNameRequired ErrCode = "1011" //寄件联系人不能为空 ErrCodeTelPhoneRequired ErrCode = "1012" //寄件电话不能为空 ErrCodeReceiverAddrRequired ErrCode = "1014" //到件地址不能为空 ErrCodeReceiverContractNameRequired ErrCode = "1015" //到件联系人不能为空 ErrCodeReceiverTelPhoneRequired ErrCode = "1016" //到件联系人不能为空 ErrCodeCargoRequired ErrCode = "1017" //到件联系人不能为空 )
Variables ¶
View Source
var ( OrderService ServiceName = "OrderService" //下单接口 OrderSearchService ServiceName = "OrderSearchService" //订单查询 OrderConfirmService ServiceName = "OrderConfirmService" //订单确认和取消 OrderFilterService ServiceName = "OrderFilterService" //订单筛选接口 OrderRouteService ServiceName = "RouteService" //订单筛选接口 RequestServiceLang = "zh-CN" RequestServiceHead = "SLKJ2019" ServiceURL = "http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService" ServiceURLHttps = "https://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService" )
View Source
var ExpressType = map[int]ExpressTypeCode{
1: {Id: 1, Code: "T4"},
2: {Id: 2, Code: "T6"},
5: {Id: 5, Code: "T8"},
6: {Id: 6, Code: "T1"},
9: {Id: 9, Code: "T13"},
10: {Id: 10, Code: "T14"},
12: {Id: 12, Code: "T4"},
13: {Id: 13, Code: "T6"},
}
Functions ¶
This section is empty.
Types ¶
type AddedService ¶
type Body ¶
type Body interface {
GetServiceName() ServiceName
}
type Config ¶
type Config struct {
ClientCode string `NTL`
CheckWord string `P9CUF8XuqBUH2ZaFpwjyqTusx12zr4uM`
Custid string
Lang string `zh-CN`
}
func (*Config) OrderConfirm ¶
func (c *Config) OrderConfirm(orderConfirm OrderConfirm) (*OrderConfirmResponse, error)
OrderConfirm 订单确认/取消接口 客户在确定将货物交付给顺丰托运后,将面单上的一些重要信息,如快件重量通过此接口发送给顺丰。 客户在发货前取消订单 订单取消之后,订单号也是不能重复利用的。
func (*Config) OrderFilterService ¶
func (c *Config) OrderFilterService(orderFilter OrderFilter) (*OrderFilterResponse, error)
OrderFilterService 客户系统通过此接口向顺丰系统发送主动的筛单请求,用于判断客户的收、派地址是否属于顺丰的收派范围。
func (*Config) OrderQuery ¶
func (c *Config) OrderQuery(orderSearch OrderSearch) (*OrderResponse, error)
OrderQuery 订单查询 因Internet环境下,网络不是绝对可靠,用户系统下订单到顺丰后,不一定可以收到顺丰系统返回的数据,此接口用于在未收到返回数据时,查询下订单(含筛选)接口客户订单当前的处理情况。
func (*Config) OrderRouteService ¶
func (c *Config) OrderRouteService(routeRequest RouteRequest) ([]RouteResponse, error)
OrderRouteService 路由查询接口 客户可通过此接口查询顺丰运单路由,系统将返回当前时间点已发生的路由信息。 路由查询接口支持三种查询方式: 根据通过丰桥接口下单的订单号查询,系统校验信息匹配将返回对应运单路由信息。 根据运单号+月结卡号(需与传入的顾客编码绑定)查询,系统校验信息归属关系正确将返回对应运单路由信息。 根据运单号+运单对应的收寄人任一方电话号码后4位(参数check_phoneNo中传入)查询,系统校验信息匹配将返回对应运单路由信息。
type ExpressTypeCode ¶
type Order ¶
type Order struct {
OrderId string `xml:"orderid,attr"` //必填
ExpressType int `xml:"express_type,attr"`
JCompany string `xml:"j_company,attr"`
JContact string `xml:"j_contact,attr"`
JTel string `xml:"j_tel,attr"`
JMobile string `xml:"j_mobile,attr"`
JProvince string `xml:"j_province,attr"`
JCity string `xml:"j_city,attr"`
JCounty string `xml:"j_county,attr"`
JAddress string `xml:"j_address,attr"`
DCompany string `xml:"d_company,attr"`
DContact string `xml:"d_contact,attr"`
DTel string `xml:"d_tel,attr"`
DMobile string `xml:"d_mobile,attr"`
DProvince string `xml:"d_province,attr"`
DCity string `xml:"d_city,attr"`
DCounty string `xml:"d_county,attr"`
DAddress string `xml:"d_address,attr"`
ParcelQuantity string `xml:"parcel_quantity,attr"`
PayMethod int `xml:"pay_method,attr"`
CustId string `xml:"custid,attr"`
CustomsBatchs string `xml:"customs_batchs,attr"`
Cargo string `xml:"cargo,attr"`
AddedService AddedService `xml:"AddedService"`
}
type OrderConfirm ¶
type OrderConfirm struct {
OrderId string `xml:"orderid,attr"` //客户订单号
MailNo string `xml:"mailno,attr"` //顺丰母运单号如果dealtype=1,必填
DealType string `xml:"dealtype,attr"` //可选,客户订单操作标识: 1:确认 2:取消
CustomsBatchs string `xml:"customs_batchs,attr"` //可选,报关批次
AgentNo string `xml:"agent_no,attr"` //可选,代理单号
ConsignEmpCode string `xml:"consign_emp_code,attr"` //可选,收派员工号
}
type OrderConfirmRequestBody ¶
type OrderConfirmRequestBody struct {
OrderConfirm OrderConfirm `xml:"OrderConfirm"`
}
func (OrderConfirmRequestBody) GetServiceName ¶
func (o OrderConfirmRequestBody) GetServiceName() ServiceName
type OrderConfirmResponse ¶
type OrderConfirmResponseBody ¶
type OrderConfirmResponseBody struct {
Response OrderResponse `xml:"OrderResponse"`
}
type OrderFilter ¶
type OrderFilter struct {
FilterType int `xml:"filter_type,attr"` //可选筛单类别: 1:自动筛单(系统根据地址库进行判断,并返回结果,系统无法检索到可派送的将返回不可派送) 2:可人工筛单(系统首先根据地址库判断,如果无法自动判断是否收派,系统将生成需要人工判断的任务,后续由人工处理,处理结束后,顺丰可主动推送给客户系统)
OrderId string `xml:"orderid,attr"` //客户订单号,filter_type=2则必须提供
Daddress string `xml:"d_address,attr"` //到件方详细地址,需要包括省市区,如:广东省深圳市福田区新洲十一街万基商务大厦。
}
type OrderFilterRequestBody ¶
type OrderFilterRequestBody struct {
OrderFilter OrderFilter `xml:"OrderFilter"`
}
func (OrderFilterRequestBody) GetServiceName ¶
func (o OrderFilterRequestBody) GetServiceName() ServiceName
type OrderFilterResponse ¶
type OrderFilterResponseBody ¶
type OrderFilterResponseBody struct {
Response OrderFilterResponse `xml:"OrderResponse"`
}
type OrderRequestBody ¶
type OrderRequestBody struct {
Order Order `xml:"Order"`
}
func (OrderRequestBody) GetServiceName ¶
func (o OrderRequestBody) GetServiceName() ServiceName
type OrderResponse ¶
type OrderResponse struct {
OrderId string `xml:"orderid,attr"`
MailNo string `xml:"mailno,attr"`
OriginCode string `xml:"origincode,attr"`
DestCode string `xml:"destcode,attr"`
FilterResult string `xml:"filter_result,attr"`
Remark string `xml:"remark,attr"`
ResStatus string `xml:"res_status,attr"`
}
type OrderResponseBody ¶
type OrderResponseBody struct {
Response OrderResponse `xml:"OrderResponse"`
}
type OrderSearch ¶
type OrderSearchRequestBody ¶
type OrderSearchRequestBody struct {
OrderSearch OrderSearch `xml:"OrderSearch"`
}
func (OrderSearchRequestBody) GetServiceName ¶
func (o OrderSearchRequestBody) GetServiceName() ServiceName
type OrderSearchResponseBody ¶
type OrderSearchResponseBody struct {
Response OrderResponse `xml:"OrderResponse"`
}
type RequestXml ¶
type ResponseBody ¶
type ResponseBody struct {
OrderResponse OrderResponse `xml:"OrderResponse"`
OrderConfirmResponse OrderConfirmResponse `xml:"OrderConfirmResponse"`
RouteResponse []RouteResponse `xml:"RouteResponse"`
OrderFilterResponse OrderFilterResponse `xml:"OrderFilterResponse"`
}
type ResponseXml ¶
type ResponseXml struct {
XMLName xml.Name `xml:"Response"`
Head Head `xml:"Head"`
Err Err `xml:"ERROR"`
Body ResponseBody `xml:"Body"`
}
type RouteRequest ¶
type RouteRequest struct {
TrackingType int `xml:"tracking_type,attr"` //可选,查询号类别: 1:根据顺丰运单号查询,order节点中tracking_number将被当作顺丰运单号处理 2:根据客户订单号查询,order节点中tracking_number将被当作客户订单号处理 3:逆向单,根据客户原始订单号查询,order节点中tracking_number将被当作逆向单原始订单号处理
TrackingNumber string `xml:"tracking_number,attr"` //查询号: 如果tracking_type=1,则此值为顺丰运单号 如果tracking_type=2,则此值为客户订单号 如果tracking_type=3,则此值为逆向单原始订单号 如果有多个单号,以逗号分隔,如"123,124,125"。
MethodType string `xml:"method_type,attr"` //可选,路由查询类别: 1:标准路由查询
CheckPhoneNo string `xml:"check_phoneNo,attr"` //可选,校验电话号码后四位值; 按运单号查询路由时,可通过该参数传入用于校验的电话号码后4位(寄方或收方都可以),如果涉及多个运单号,对应该值也需按顺序传入多个,并以英文逗号隔开。
}
type RouteRequestBody ¶
type RouteRequestBody struct {
RouteRequest RouteRequest `xml:"RouteRequest"`
}
func (RouteRequestBody) GetServiceName ¶
func (r RouteRequestBody) GetServiceName() ServiceName
type RouteResponse ¶
type RouteResponseBody ¶
type RouteResponseBody struct {
Response []RouteResponse `xml:"OrderResponse"`
}
type ServiceName ¶
type ServiceName string
type UserInfo ¶
type UserInfo struct {
Company string `xml:"d_company,attr"`
Contact string `xml:"d_contact,attr"`
Tel string `xml:"d_tel,attr"`
Mobile string `xml:"d_mobile,attr"`
Province string `xml:"d_province,attr"`
City string `xml:"d_city,attr"`
County string `xml:"d_county,attr"`
Address string `xml:"d_address,attr"`
}
Click to show internal directories.
Click to hide internal directories.