{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"7d3722ae-7ae5-43b6-8741-7a9442a47fef","name":"Motion Pay POS API","description":"# Chapter 1: Introduction\n\n\n## 1.1 Purpose\n\nThis document is the official manual for MotionPay`s payment APIs. It is the tutorial for technical architects, R&D engineers, testing engineers and service engineers for the integrated WeChatPay and Alipay system, which includes vendors' systems such as online shopping platforms, cashier systems, or POS systems.\n\n## 1.2 Audience\n\n- Software developers for mobile payment platform\n- Third party interface\n\n## 1.3 Terms\n\n### 1.3.1 Merchant Scan Customer Mobile\nThe Customer shows their barcode/QR Code on WeChat's or Alipay app to the Vendor to scan in order to pay directly. This mode applies to in-store payment scenarios.\n\n### 1.3.2 Customer Mobile Scan Merchant\nThe Merchant generates a transaction QR Code according to the MotionPay Protocol on their POS terminal and the Customer scan QR Code from their app in order to complete the payment. This mode is applicable to payments made on websites, physical stores, media advertising, or other scenarios.\n\n\n\n# Chapter 2: Interface Specification\n\n- Please use HTTP &#39;POST&#39; method to access the URL, both the request data and response data are in JSON format\n- All data encoding is using &#39;UTF-8&#39;\n- This is the API URL format. The &#39;{actionPath}&#39; is the function name. For example &#39;pay/order&#39;. http[s]://host/payment/{actionPath}\n\n- **The Test API URL : https://api.motionpay.org/payment/{actionPath}**\n- **The test merchant ID : 100122220000005**\n- **The test App ID : 5005642019001**\n- **The test App Secure : ae26b1841a7291379db606e41bfa4417**\n\n## 2.1 Data encryption\n\n- The data is encrypted by SHA1 signature. The {appid} and {appsecret} is provided by MotionPay\n- The signature is generated by the following steps:\n\nPut all the data in the 'param' into a set M. Remove the parameters which have empty/null value. Order the **param** set M by the parameter names using &#39;ASCII&#39; code (increasing). Put all the parameters (names and values) into a string A in this format (&quot;key1=value1&amp;key2=value2…&quot;). It is the same format as the HTTP get method.\n\n    - Only the data in 'param' needs to be there\n    - Order by parameter names by ASCII code increasing\n    - Parameters which have Empty or Null value need to be removed\n    - Parameter names and values are case sensitive\n\n\nAppend &#39;appid={appid}&amp;appsecret={appsecret}&#39; to the end of the StringA you get from step 1 to get stringSignTemp. Use SHA1 method to encrypt stringSignTemp. Then you will get the **signValue** for the sign parameter.\n  \n    - {appid} and {appsecret} are provided by MotionPay\n    - signValue is the signature value for the sign parameter\n    - signValue need to be in small case.\n\nSample of stringSignTemp:\n\n```\namount=1&amp;authcode=284773369684066898&amp;merchantorderno=2018080974810084&amp;paramjsonobject={&quot;goods\\_info&quot;:&quot;Test\\_Product&quot;,&quot;spbill\\_create\\_ip&quot;:&quot;192.168.2.253&quot;,&quot;store\\_id&quot;:&quot;&quot;,&quot;terminal\\_no&quot;:&quot;WP15461Q00001350&quot;}&amp;paychannel=U&amp;appid=5005642017008&amp;appsecret=cd3f5e88a1ec1df2351cdca75d7ce94a\n```\n\nSample of signValue generated by SHA1:\n\n```javascripts\n85171774a62ce5806abd0f1417dcc059dbfbebb7\n```\n\n\n- You can use some online tools to check the SHA1 result you generated:\n>http://www.sha1-online.com/\n\n## 2.2 Payment Amount\nThe currency type for transaction is CAD (Canadian Dollar) by default. The unit used in payment amount is 【cent】 and must be an integer. \n\n## 2.3 Merchant Order Number\nThe order number has to be generated manually, javascript example:\n\n```javascript\nfunction pad2(n) { return n < 10 ? '0' + n : n }\n\nvar date = new Date();\n\norderNo = date.getFullYear().toString() + pad2(date.getMonth() + 1) + pad2( date.getDate()) + pad2( date.getHours() ) + pad2( date.getMinutes() ) + pad2( date.getSeconds() ) ;\n\norderNo = orderNo.toString();\n\n// orderNo: 20190112151250\n```\n\n## 2.3 Auth Code\nAuth code is used in Merchant Scan Customer Mobile and displayed by a customer in Wechat or Alipay APP.\n\n\n\n\n\n# Chapter 3: API List","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"6368806","team":252008,"collectionId":"7d3722ae-7ae5-43b6-8741-7a9442a47fef","publishedId":"RztfvrCA","public":true,"publicUrl":"https://posapidoc.motionpay.org","privateUrl":"https://go.postman.co/documentation/6368806-7d3722ae-7ae5-43b6-8741-7a9442a47fef","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","version":"8.10.1","publishDate":"2019-08-29T14:01:35.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/e950423dd4441e5e2c39284d1c7fece4479b221c4db2f8b76ea21ddd8882967a","favicon":"https://motionpay.org/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://posapidoc.motionpay.org/view/metadata/RztfvrCA"}