# Create an Order

# Examples of Interface Requests

Interface Force Check Source IP

http请求方式:POST
https://api.weixin.qq.com/shop/pay/createorder?access_token=xxxxxxxxx

# Example of request parameters

{
    "openid": "oTVP50O53a7jgmawAmxKukNlq3XI",
    "combine_trade_no": "P20150806125346",
    "expire_time":1647360558,
    "sub_orders":[
        {
            "mchid":"1230000109",
            "amount":100,
            "trade_no":"20150806125346",
            "description": "Image形象店-深圳腾大-QQ公仔"
        }
    ]
}

# Examples of back-up

{
    "errcode": 0,
    "errmsg":"ok",
    "payment_params": {
        "timeStamp":1639124652
        "nonceStr":"123",
        "package":"prepay_id=123",
        "paySign":"12904324823458940394",
        "signType":"MD5"
    }
}

# Dxplaination of request parameters

parameter type Is it compulsory? Introductions
openid string yes User's openid
combine_trade_no string yes The total transaction number for merchant contract payments is between 6 and 32 characters in length, and can only be a number, upper and lower case letters_-|*@, Weixin Mini Program System only.The same combine_trade_no is treated as the same request, and no modification of suborders and other parameters is allowed.
expire_time number no Order Expiration Time, Second Clock
sub_orders Array Object SubOrder yes List of Sublists

# Dxplaination of callback parameters

Field Name type Introductions
errcode number Error code
errmsg string Error message
payment_params Object PaymentParams Payment Parameters

# Object SubOrder

Field Name type Is it compulsory? Introductions
mchid string yes Merchant account number corresponding to transaction order
description string yes Product Description
amount number yes Order Amount, in units
trade_no string yes Merchant transaction number can only be a number and upper and lower case letters_-|*@ ,The length is 6 ~ 32 characters, guaranteed unique within the system. The same trade_no is allowed to modify parameters such as price.

# Object PaymentParams

Field Name type Is it compulsory? Introductions
timeStamp string yes Time stamp, the number of seconds from 00: 00: 00 on 1 January 1970, i.e. the current time
nonceStr string yes Random character string, less than 32 characters long
package string yes Unify the prepay_id parameter value returned by the single interface in the submission format such as: prepay_id =**\ *
paySign string yes Signature, see WeChat Payment Document
signType string yes Signature Algorithm