# Increase shipping rates template

# Dxplaination of Interface Call Request

http请求方式:POST
https://api.weixin.qq.com/product/delivery/insert_freight_template?access_token=xxxxxxxxx

# Example of request parameters

{
    "freight_template":{
        "name":"新疆西藏高邮费,北京市条件包邮,其他地区低邮费",
        "valuation_type":1,
        "send_time":7,
        "address_info":
        {
            "province_name":"北京市",
            "city_name":"北京市",
            "county_name":"东城区"
        },
        "delivery_type":1,
        "delivery_id":[""],
        "shipping_method":2,
        "all_condition_free_detail":
        {
            "condition_free_detail_list":
            [
               {
                   "address_infos":
                   [
                       {
                           "province_name":"北京市"
                       }
                   ],
                   "min_piece":2,
                   "min_amount":100,
                   "valuation_flag":1,
                   "amount_flag":1
                } 
            ]
        },
        "all_freight_calc_method":
        {
            "freight_calc_method_list":
            [
               {
                   "address_info":
                   [
                       {
                           "province_name":"新疆维吾尔自治区"
                       },
                       {
                           "province_name":"西藏自治区"
                       }
                   ],
                   "is_default":false,
                   "first_val_amount":1,
                   "first_price":1000,
                   "second_val_amount":1,
                   "second_price":800
              },
              {
                   "address_info":[],
                   "is_default":true,
                   "first_val_amount":1,
                   "first_price":800,
                   "second_val_amount":1,
                   "second_price":400
              }

            ]
        },
        "is_default":0,
        "not_send_area":
        {
            "address_info":[]
        }
    } 
}

# Examples of back-up

{
    "errcode" : 0,
    "errcode" : "",
}

# Dxplaination of request parameters

参数 type Is it compulsory? Introductions
freight_template.name string yes Shipping Model Name
freight_template.valuation_type nunber yes How to bill
freight_template.send_time number yes Shipping time
freight_template.address_info object no Shipping Address
freight_template.delivery_type number yes Delivery methods
freight_template.delivery_id[] array no List of courier companies
freight_template.shipping_method number yes Whether or not to include shipping, you need to specify the default freight rate in all_freight_calc_method when you do not include shipping
freight_template.all_condition_free_detail object no Conditions Postal details
freight_template.all_freight_calc_method object no Specific method of billing
freight_template.is_default number no Is this the default template?
freight_template.not_send_area object no Areas not shipped

# object-address_info

参数 type Is it compulsory? Introductions
province_name string no province
city_name string no city
county_name string no Districts and Counties

# object-all_condition_free_detail

Fill in at least one min_weight and min_amount for billing by weight, fill in at least one min_piece and min_amount for billing by quantity

参数 type Is it compulsory? Introductions
condition_free_detail_list[].address_infos object yes Address_info Address_info
condition_free_detail_list[].min_piece number no Minimum number of parcels
condition_free_detail_list[].min_amount number no Minimum Amount for Postal
condition_free_detail_list[].min_weight number no Shipping Minimum Weight
condition_free_detail_list[].valuation_flag number no Whether the corresponding option for billing method is already set
condition_free_detail_list[].amount_flag number no Is the amount set?

# object-all_freight_calc_method

参数 type Is it compulsory? Introductions
freight_calc_method_list[].address_info object yes Address_info Address_info
freight_calc_method_list[].is_default boolen yes Whether it is the default shipping rate, if it is the default shipping rate, address_info must be empty
freight_calc_method_list[].delivery_id string no A courier company
freight_calc_method_list[].first_val_amount number yes First leg freight meets weight, unit kg
freight_calc_method_list[].first_price number yes The amount of the first leg of freight, in unit
freight_calc_method_list[].second_val_amount number yes Renewal Unit Weight, Unit Kg
freight_calc_method_list[].second_price number yes Amount of increase in renewal cost per unit, unit divided

# object-not_send_area

参数 type Introductions
address_info object No delivery area, same structure as address_info

# Dxplaination of callback parameters

参数 type Introductions
errcode string Error code
errmsg string Error message

# Enumeration value -valuation_type

枚举值 describe
1 Order by Order
2 By weight

# Enumeration value - send_time

枚举值 describe
1 4 hours
2 8 hours
3 12 hours
4 16 hours
5 20 hours
6 24 hours
7 48 hours
8 3 days
9 5 days
10 7 days
11 10 days
12 12 days
13 14 days
14 16 days
15 20 days
16 25 days
17 30 days
18 35 days
19 45 days

# Enumeration value - delivery_type

枚举值 describe
1 express delivery

# Enumeration value - shipping_method

枚举值 describe
1 shipping included
2 Conditions Postal
3 No mail.

# Return code

返回码 Error Type
-1 System exceptions
-2 Token too long