从 Square Connect 获取项目名称 API

Getting item names from Square Connect API

我想知道如何从 Square 上的交易中获取此项目描述/信息。对我来说,即使使用:

'/v2/locations/{0}/transactions/{1}'.format(LOC_ID, tid)

没有return任何项目名称,相反我得到了完整的anonymous/useless信息:

 {
  "transaction": {
    "id": "BZDxxxxxx",
    "location_id": "3PBxxxxx",
    "created_at": "2016-10-14T22:55:33Z",
    "tenders": [
      {
        "id": "VJO1rxxxxx",
        "location_id": "3PBxxxx",
        "transaction_id": "BZDxxxxxx",
        "created_at": "2016-10-14T22:55:31Z",
        "amount_money": {
          "amount": 2800,
          "currency": "USD"
        },
        "processing_fee_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "OTHER"
      }
    ],
    "product": "REGISTER",
    "client_id": "1E7xxxx"
  }
}

如何从上面 return 编辑的内容转到网站交易列表中显示的项目名称?

您可以使用 Orders Endpoints 逐项列出您的交易 您是否尝试过使用 /v1/{location_id}/payments 端点?您可以在那里获得有关这些项目的更多信息。

https://docs.connect.squareup.com/api/connect/v1/#updatingorderstate