Rest 我能';无法从square up平台服务器获取订单列表
得到以下结果Rest 我能';无法从square up平台服务器获取订单列表,rest,express,point-of-sale,square-connect,Rest,Express,Point Of Sale,Square Connect,得到以下结果 var request = require("request"); var options = { method: 'GET', url: 'https://connect.squareup.com/v2/locations/{location_id}/transactions', headers: { 'postman-token': 'token', 'cache-control': 'no-cache', authorization: '
var request = require("request");
var options = { method: 'GET',
url: 'https://connect.squareup.com/v2/locations/{location_id}/transactions',
headers:
{ 'postman-token': 'token',
'cache-control': 'no-cache',
authorization: 'Bearer square_token' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
“交易”:[
{
“id”:“wDWQ6dH7q4IneSDTpEx3zI2eV”,
“位置id”:“3XT6YVHAYDPFS”,
“创建时间”:“2017-07-06T13:40:15Z
”,
“投标书”:[
{
“id”:“Izpuslhgnacnohfysnpkqb”,
“位置id”:“3XT6YVHAYDPFS”,
“交易id”:“wDWQ6dH7q4IneSDTpEx3zI2eV”,
“创建时间”:“2017-07-06T13:40:13Z”,
“金额”:{
“金额”:730,
“货币”:“美元”
},
“处理费用和金钱”:{
“金额”:0,
“货币”:“美元”
},
“类型”:“现金”,
“现金详情”:{
“买方投标金额”:{
“金额”:730,
“货币”:“美元”
},
“换回钱”:{
“金额”:0,
“货币”:“美元”
}
}
}
],
“产品”:“注册”,
“客户id”:“60FA84DB-865C-4DC2-B824-56A4F87B7264”
},
我无法获取订单食品和咖啡项目以及修改器,只能获取金额。要获取项目信息,请使用v1端点
"transactions": [<br>
{
"id": "wDWQ6dH7q4IneSDTpEx3zI2eV",<br>
"location_id": "3XT6YVHAYDPFS",<br>
"created_at": "2017-07-06T13:40:15Z<br>",
"tenders": [<br>
{<br>
"id": "IZPusLhhGnacnOHFysNpKQB",<br>
"location_id": "3XT6YVHAYDPFS",<br>
"transaction_id": "wDWQ6dH7q4IneSDTpEx3zI2eV",<br>
"created_at": "2017-07-06T13:40:13Z",<br>
"amount_money": {<br>
"amount": 730,<br>
"currency": "USD"<br>
},<br>
"processing_fee_money": {<br>
"amount": 0,<br>
"currency": "USD"<br>
},<br>
"type": "CASH",<br>
"cash_details": {<br>
"buyer_tendered_money": {<br>
"amount": 730,<br>
"currency": "USD"<br>
},<br>
"change_back_money": {<br>
"amount": 0,<br>
"currency": "USD"<br>
}<br>
}<br>
}<br>
],<br>
"product": "REGISTER",<br>
"client_id": "60FA84DB-865C-4DC2-B824-56A4F87B7264"<br>
},<br>