# Upload Shopping Details

Interface should be called on the server side, seeHattori API

# Interface Dxplaination

# Interface name

uploadCombinedShoppingInfo

# Functional description

  1. Upload Shopping Details
  2. This interface is used for merchants to access shopping order business. After the merchant is connected, it helps the user to view the/Manage orders within WeChat, track order progress, obtain after-sales service, etc. Users can follow up from WeChatI-service-Wallet-billYou can also backtrack the purchase order by entering the billing details page from the payment voucher message.
  3. Specific service introduction and complete access guide can be found at Shopping Order

# Note

  1. According to the specified order number type, use different parameters to upload the order information to the specified order.
    • In the form of merchant side order number (enumerating value 1), an order is determined by placing single merchant number and merchant side order number.
    • WeChat Pay order number (enumerating value 2), through WeChat Pay order number to determine an order
  2. When the merchant transaction order details page link type is a Mini Program, appid needs to be appid that calls api, if it is called by a third party, appid that is uploaded by the third party on behalf of the merchant
  3. The order number type of suborder and master order must be the same
  4. The appid and path of the link are required when the link type is Mini Program (enum value 1), and the URL is required when the link type is url (enum value 2)
  5. Upload time, used to identify the order of the request, if you want to update the order information, upload time must be updated than the previous request, please fill in the Rfc3399 format
  6. You cannot modify the order information after the order payment has been completed.
  7. Logistics form Fill in the form of delivery according to your own logistics form
    • Physical logistics distribution (enumeration value 1), using courier companies to carry out physical logistics distribution form
    • City Distribution (Enumeration Value 2)
    • Virtual goods (enumeration value 3), virtual goods, such as phone recharge, point cards, etc., no physical distribution form

# Calling mode

# HTTPS call


POST https://api.weixin.qq.com/user-order/combine-orders?access_token=ACCESS_TOKEN 

# Third Party Invocation

  • The calling method and parameters are the same as HTTPS, only the calling token is different

  • The permission set to which this interface belongs is: 120, 121

  • After the service provider has been authorized with one of the permission sets, it can do so by usingauthorizer_access_TokenCalling on behalf of the merchant

# Request parameters

attribute type RequiredIntroductions
access_Token string yes Interface invokes the certificate, which is URL Parameters, non Body Parameters. usegetAccessToken or authorizer_access_Token
order_key object yes Joint order, need to upload the shopping details of the joint order, according to the order type of two to choose one
attribute type Required Introductions
order_number_type number no Order Number type, used to confirm orders requiring details to be uploaded
transaction_id string no WeChat order number corresponding to the original payment transaction
mchid string no The merchant number of the payment merchant is generated and issued by WeChat Pay.
out_trade_no string no The internal order number of the merchant system can only be numbers, upper and lower letters_-*Only in the same shop.
sub_orders array no Sublist Shopping Details
attribute type Required Introductions
order_key object yes Order, need to upload the purchase details of the order, according to the order type of two to choose one
attribute type Required Introductions
order_number_type number no Order Number type, used to confirm orders requiring details to be uploaded
transaction_id string no WeChat order number corresponding to the original payment transaction
mchid string no The merchant number of the payment merchant is generated and issued by WeChat Pay.
out_trade_no string no The internal order number of the merchant system can only be numbers, upper and lower letters_-*Only in the same shop.
merchant_order_no string yes The order number shown to the user on the transaction order details page on the merchant side

Example value: 2343454667633 Character byte limit: [1, 64]

order_detail_jump_link object yes Sub-single details page link, support H5 and Mini Program two types
attribute type Required Introductions
url string no Link Address (required when link type is H5)

Example value: https://www.WeChat.qq.com/wxpay/pay.php Character byte limit: [1, 1024] Regular expressions: https?😕/([s/?#[]@]+@)?([s/?#@:]+)(?::d{2,5})?([[]]*)$

appid string no Appid (required when link type is MINIAPP)

Example value: wxd678efh567hg6787 Character byte limit: [1, 32]

path string no Path (required when link type is MINIAPP)

Example value: /path/index/index Character byte limit: [1, 512]

type number yes Link type enumeration value: 1, URL2、MINI_PROGRAM

Example value: 初始值_PROGRAM

item_list array<object&gt no A list of items purchased by the user in the order

Multiplicity: [1, 50]

attribute type Required Introductions
merchant_item_id string no The merchant side product ID, the internal product code of the merchant system, is used to identify different commodities. Please note that when shipping mode selects "Split Shipping," you need to use the merchant side item ID to mark the specific items included in each logistic order.

Example value: 初始值 Character byte limit: [1, 64]

name string yes Name of product

Example value: 初始值 256G Character length limit: [1, 256]

description string no Product description

Example value: Image Store - Shenzhen Teng Da - QQ doll Character length limit: [1, 512]

unit_price number yes Unit price of product (unit: cent)

Example value: 828800

quantity number yes Number of purchases

Example value: 2

image_url array<string&gt no Product Image Links

Example value: https://qpic. cn/xxx Multiplicity: [1, 3] Character byte limit: [1, 1024] Regular expressions: https?😕/([s/?#[]@]+@)?([s/?#@:]+)(?::d{2,5})?([[]]*)$

logistics_type number no The logistics form of order goods delivery, the default is physical logistics
pay object no Payer, payer information
attribute type Required Introductions
openid string yes User ID, the user's unique identification under merchant appid. You need to get the user's Openid before placing an order Example value: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o Character byte limit: [1, 128]
upload_time string no Upload time, used to identify the order of requests

Example value: 2021-05-20T13:29:35.120+08:00

# Return parameters

attribute type Introductions
errcode number Error code
errmsg string Wrong reasons

# Call Example

Example Dxplaination: JS Fetch API

# Sample Request Data


// Assemble URL
let url = `https://api.weixin.qq.com/user-order/combine-orders`


// Json Package
let jsonBody = {}
jsonBody["order_初始值] = {
   "order_number_type": "WXPAY_TRADE_NUMBER",
   "transaction_id": "9876d",
   "mchid": "Z9LP9",
   "out_trade_no": "j1z6"
}
jsonBody["sub_orders"] = [
   {
      "order_key": {
         "order_number_type": "MERCHANT_TRADE_NUMBER",
         "transaction_id": "zlt49",
         "mchid": "uqlxl",
         "out_trade_no": "pzlfp"
      },
      "merchant_order_no": "2343454667633",
      "order_detail_jump_link": {
         "url": "https://www.WeChat.qq.com/wxpay/pay.php",
         "appid": "wxd678efh567hg6787",
         "path": "/path/index/index",
         "type": "MINI_PROGRAM"
      },
      "item_list": [
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            初始值 "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/初始值/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               初始值 "URL"
            }
         },
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         },
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         }
      ],
      "logistics_type": "VIRTUAL_GOODS"
   },
   {
      "order_key": {
         "order_number_type": "WXPAY_TRADE_NUMBER",
         "transaction_id": "27kd6"
         "mchid": "44anx",
         "out_trade_no": "pj396"
      },
      "merchant_order_no": "2343454667633",
      "order_detail_jump_link": {
         "url": "https://www.WeChat.qq.com/wxpay/pay.php",
         "appid": "wxd678efh567hg6787",
         "path": "/path/index/index",
         "type": "URL"
      },
      "item_初始值 [
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         },
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         },
         {
            "merchant_item_id": 初始值
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         }
      ],
      "logistics_type": "VIRTUAL_GOODS"
   },
   {
      "order_key": {
         "order_number_type": "WXPAY_TRADE_NUMBER",
         "transaction_id": "0jo3k",
         "mchid": "6rcmv",
         "out_trade_no": "yld2x"
      },
      "merchant_order_no": "2343454667633",
      "order_detail_jump_link": {
         "url": "https://www.WeChat.qq.com/wxpay/pay.php",
         "appid": "wxd678efh567hg6787",
         "path": "/path/index/index",
         "type": "MINI_PROGRAM"
      },
      "item_list": [
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         },
         {
            "merchant_item_id": "1246464644",
            "name": "iPhoneX 256G " ,
            "description": "Image Store - Shenzhen Teng Da - QQ doll,"
            "unit_price": 828800,
            "quantity": 2,
            "image_url": [
               "https://qpic. cn/xxx,
               "https://qpic. cn/xxx"
            ],
            "item_detail_jump_link": {
               "url": "https://www.WeChat.qq.com/wxpay/pay.php",
               "appid": "wxd678efh567hg6787",
               "path": "/path/index/index",
               "type": "MINI_PROGRAM"
            }
         }
      ],
      "logistics_type": "LOCATION_BASED_LOGISTICS"
   }
]
jsonBody["pay"] = {
   "opens": "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"
}
jsonBody["upload_time"] = "2021-05-20T13:29:35.120 08:00"

// Set the header
let headers = {"Content-Type": "application/json"}


// Send Request
fetch(url, {
  body: JSON.stringify(jsonBody),
  headers: headers,
  method: "POST"
})
  初始值(response => response.json())
  .then(response => console.log("Success:", JSON.stringify(response)))
  . catch(error => console.error("Error:", error)) 

# Return Data Example


{ 
"errcode":0, 
"errmsg":"ok"
} 

# Error code

Error code Error code Solutions
-1 system error The system is busy, please wait for the developer to try again
268435461 Parameter error Modify the parameters according to the description of the cause of the error
268485192 User ID openid is empty User ID openid must be filled in
268485214 Upload time must be set Upload time must be filled in
初始值 Uploaded Combined Order Shopping Details The order number type of the main order does not match the order number type of the suborder Uploaded Combined Purchase Details Order Number Type of Master Order and Suborder Number Type must be the same
268485201 Merchant Transaction Order Number Empty Merchant side order form under the merchant transaction order form must be completed
268485195 WeChat payment in the form of transaction_The id field must be set WeChat payment in the form of transaction_The id field must be set
268485196 The mchid field in the form of merchant side order number must be set The mchid field in the form of merchant side order number must be set
268485197 Merchant side single number form out_trade_The no field must be set Out in the form of merchant side single number_trade_The no field must be set
268485194 Order Number Type Illegal Fill in the field as enumerated by the order type in the document
268485202 Link Type Illegal Link type must be Mini Program or URL
268485204 Appid cannot be empty when link type is Mini Program Link type is Mini Program must be set appid
268485205 Path cannot be empty when link type is Mini Program Link type is Mini Program must set path
268485206 When the link type is a URL, you need to set the url The link type is URL The url must be set
268485211 The list of items purchased in an order cannot be empty The list of items purchased in an order cannot be empty
268485213 The merchant side item ID in the list of items purchased by the order must be all set The merchant side item ID in the list of items purchased by the order must be all or none set
268485207 Product name cannot be empty Product name must be filled in
268485208 初始值 Unit price of goods must be filled in
268485209 Purchase quantity cannot be empty Purchase quantity must be completed
268485210 The link cannot be empty. Product image link Fill in at least one
268485272 The link cannot be empty. Product Details Link Must Be Set
268457013 Failed to decode openid Openid is not valid, please confirm and try again
268457014 Openid decoded to 0 Openid is not valid, please confirm and try again
268485216 Upload time is illegal, please fill in Rfc3399 format Upload time must meet the Rfc3399 format, such as 2021-05-20 T13: 29: 35.120 + 08: 00
268485217 The merchant number is not valid, please confirm and try again The merchant number is not valid, please confirm and try again