服务查询


查询可使用的服务
Method POST /service

Query 参数

limit, skip, keywords, sort

Body 参数

参数 说明 类型 必填 默认值
initiation 出发地 Object  
initiation/regionCode 出发地 所在国家/地区代码 例: CA String    
destination 目的地 Object  
destination/regionCode 目的地 所在国家/地区代码 例: CA, US String    
shipmentType 货品类型 :( parcel包裹, env 文件) String  

Request Example

POST /service?limit=10&skip=0&keyword=america,canada&sort[]=regionName:desc&sort[]=countryCode:asc

Request Body

{
    "initiation": {
        "regionCode": "CA"
    },
    "destination": {
         "regionCode": "CA"
    },
    "shipmentType": "parcel"
}

Response

参数 说明
serviceName 服务名称 例: 加国信件
serviceCode 服务代码 例: cp.dom.ep.env
carrierName 货运商名称
carrierCode 货运商代码
carrierServiceName 货运商服务名称
shipmentType 货品类别
restriction 货品规格限制
restriction/size 尺寸
restriction/size/girth 周长
restriction/size/sum 三边长总和
restriction/size/length 单边长度
restriction/size/weight 重量

Reponse Example

{
    "sucess": true,
    "elapsed": "467ms",
    "query": {
        "id": "7f16f1b0-61bf-11eb-ae75-75abac9d9f41",
        "timestamp": "1612789712",
        "signature": "/f99ppBMe0hEtY8Ror04J4JcjpvMuv19eVUrHl7ndXQ=",
        "api": "/service"
    },
    "result": {
        "count": 2,
        "rows": [
            {
                "serviceName": "加国信件",
                "serviceCode": "cp.dom.ep.env",
                "carrierName": "Canada Post",
                "carrierCode": "canPost",
                "carrierServiceName": "Expedited Parcel",
                "shipmentType": "env",
                "restriction": {
                    "weight": {
                        "max": {
                            "kg": 1,
                            "lb": 2.2
                        }
                    }
                }
            },
            {
                "serviceName": "加国包裹",
                "serviceCode": "cp.dom.ep.parcel",
                "carrierName": "Canada Post",
                "carrierCode": "canPost",
                "carrierServiceName": "Expedited Parcel",
                "shipmentType": "parcel",
                "restriction": {
                    "size": {
                        "girth": {
                            "max": {
                                "cm": 300,
                                "in": 118
                            }
                        },
                        "length": {
                            "max": {
                                "cm": 200,
                                "in": 78.7
                            }
                        }
                    },
                    "weight": {
                        "max": {
                            "kg": 30,
                            "lb": 66
                        }
                    }
                }
            }
        ],
        "limit": "20",
        "skip": "0"
    }
}