我无法从 square up 平台服务器获取订单列表
I can't get the order list from square up platform server
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
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