# 5.1 Unified Order

## 1. Overview <a href="#id-1overview" id="id-1overview"></a>

Use this API to get the cashier page address. After getting the cashier page address, you can redirect the user to the cashier page to make a payment.

## 2. Request Info <a href="#id-2request-info" id="id-2request-info"></a>

* **Method:** post
* **Path:** <https://prod-openapi-v2.newpay.la/beta/pay/unifiedOrder>

### **2.1 Request Header** <a href="#id-21-request-header" id="id-21-request-header"></a>

| Key          | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

### **2.2 Request Data** <a href="#id-22-request-data" id="id-22-request-data"></a>

<table><thead><tr><th>Name</th><th width="372">Description</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>appId</td><td>Unique identifier assigned to a third-party application platform</td><td>string</td><td>true</td></tr><tr><td>mchId</td><td>Unique identifier assigned to a third-party merchant</td><td>string</td><td>true</td></tr><tr><td>mchOrderNo</td><td>Order number in the third party merchant</td><td>string</td><td>true</td></tr><tr><td>channel</td><td><p><em>WECHAT_ONLINE:</em> 微信线上支付</p><p><em>WECHAT_APP:</em> 微信APP支付</p><p><em>WECHAT_MINI_APP:</em> 微信小程序支付</p><p><em>ALIPAY_ONLINE:</em> 阿里线上支付<br>LAP_NET_ONLINE: LAO QR 动态码<br>WECHAT_DYNAMIC : 微信动态码<br>ALIPAY_DYNAMIC ：阿里线下动态码<br>NEWPAY_ONLINE: NewPay App 支付</p></td><td>string</td><td>true</td></tr><tr><td>currency</td><td>CNY: 人民币<br>USD: 美元<br>LAK: 老挝币</td><td>string</td><td>true</td></tr><tr><td>orderAmt</td><td>Payment amount</td><td>string</td><td>true</td></tr><tr><td>subject</td><td>Commodity title</td><td>string</td><td>false</td></tr><tr><td>callBackUrl</td><td>Payment result notification URL</td><td>string</td><td>true</td></tr><tr><td>redirect</td><td>redirect url after payment successfully</td><td>string</td><td>false</td></tr><tr><td>attach</td><td>Third party order supplementary fields</td><td>string</td><td>false</td></tr><tr><td>extraParam</td><td><p>Additional parameters.<br><br><strong>For wechat Mini app payment</strong>:</p><p><em><strong>Scene 1</strong></em>, inside wechat: it is "wxCode -> xxxxxx", the payReference in the response is like "prepay_id = xxxxxx, signType=rsa, paySign=xxxxx", you can use these info call payment directly ;<br><em><strong>Scene 2</strong></em>, outside wechat: it is null, the payReference in the response is the scheme of the mini app, user can scan the scheme by wechat, and use <a href="../4.-apis-v1-deprecated/4.2.-wechat-payment-apis/4.2.3-obtain-payment-information">getMinPayment</a> method to payment;</p><p><em><strong>Scene 3</strong></em>, for DEV env: it is "envVersion -> trial".<br><br>Ref Doc:<br>1, <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012791897">JSAPI pay</a>;<br>2, <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012791898">Request Payment.</a></p><p></p><p><strong>For</strong> <a href="../7.-newpay-h5-payment-integration"><strong>NewPay H5 Payment Integration</strong></a>:<br>{"agentReference":"true","userId":"<code>100234</code>"} </p></td><td>json</td><td>false</td></tr><tr><td>sign</td><td><a href="../8.-signature-and-verification">Data signature</a></td><td>string</td><td>true</td></tr></tbody></table>

### **2.3 Response Data** <a href="#id-23-response-data" id="id-23-response-data"></a>

<table><thead><tr><th>Name</th><th width="330">Description</th><th>Type</th></tr></thead><tbody><tr><td>success</td><td>Success flag: true/false</td><td>boolean</td></tr><tr><td>message</td><td>Response message</td><td>string</td></tr><tr><td>code</td><td><a href="../../9.-business-code#response-code">Reponse code</a></td><td>string</td></tr><tr><td>timestamp</td><td>Response timestamp</td><td>long</td></tr><tr><td>data</td><td>Result</td><td>object</td></tr><tr><td>> appId</td><td>Unique identifier assigned to a third-party application platform</td><td>string</td></tr><tr><td>> payStatus</td><td>SUCCESS/FAIL/EXPIRED/PROCESSING</td><td>string</td></tr><tr><td>> orderAmt</td><td>Payment amount and currency</td><td>json</td></tr><tr><td>  >> value</td><td>amount value</td><td>string</td></tr><tr><td>  >> currency</td><td>CNY: 人民币<br>USD: 美元<br>LAK: 老挝币</td><td>string</td></tr><tr><td>> newpayOrderNo</td><td>NewPay order number</td><td>string</td></tr><tr><td>> mchOrderNo</td><td>Order number in the third party merchant</td><td>string</td></tr><tr><td>> payMethod</td><td><p>PAY_METHOD_WECHAT/</p><p>PAY_METHOD_ALIPAY_PLUS</p></td><td>string</td></tr><tr><td>> orderType</td><td>DYNAMIC_CODE: 动态收款码<br>STATIC_CODE: 静态收款码<br>APP: 线上APP<br>MINI_APP: 线上小程序<br>ONLINE: 线上支付</td><td>string</td></tr><tr><td>> payReference</td><td>Payment address</td><td>string</td></tr><tr><td>> sign</td><td>Data signature</td><td>string</td></tr></tbody></table>
