我无法从方形平台服务器获取订单列表


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);
});

获得以下结果;

"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>

我无法订购食物和咖啡物品和修饰符,只能获得金额。

若要获取明细信息,请使用 v1 终结点。 https://docs.connect.squareup.com/api/connect/v1/#navsection-transactions

最新更新