> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取机器的最后销售记录并生成电子收据

本页面介绍了如何使用 Lynx API 以及 Nayax Core，通过机器的 Machine ID 检索其 Last Sales（最近销售记录）。本指南将使用以下端点：

[/reference/zh/lynx/machines/get-last-sales-for-machine-by-machineid](https://devzone.nayax.com/reference/zh/lynx/machines/get-last-sales-for-machine-by-machineid.md)

[/reference/zh/lynx/ereceipt/generate-ereceipt-for-your-transaction](https://devzone.nayax.com/reference/zh/lynx/ereceipt/generate-ereceipt-for-your-transaction.md)

> [!WARNING]
>
> 验证
>
> 请参阅本文档的[“安全和令牌”](https://devzone.nayax.com/docs/manage-data-operations/lynx-api/security)页面，了解如何访问您的令牌，以及如何正确使用它来验证您的 API 请求。

## 检索机器的最近销售记录

要通过 Machine ID 检索机器的最近销售记录，您需要使用 [Get Last Sales for Machine](https://devzone.nayax.com/reference/zh/lynx/machines/get-last-sales-for-machine-by-machineid.md) 端点。通过在请求中提供该机器的 Machine ID，您可以检索到相应机器的唯一标识符。

以下代码块示例展示了该请求，使用 `MachineID` 作为查询参数来筛选结果：

```sh theme={null}
curl -X 'GET' \
  'https://qa-lynx.nayax.com/operational/v1/machines/<MACHINE_ID>/lastSales' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'
```

> [!NOTE]
>
> Remember to replace `<MACHINE_ID>` with the actual machine's Machine ID.

响应将包含有关该机器的详细信息，包括机器的 ID。

```json theme={null}
[
  {
    "TransactionID": 4625276436,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 700,
    "SettlementValue": 700,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 700.00)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-02-08T09:31:51.817",
    "MachineAuthorizationTime": "2026-02-08T11:31:51.46",
    "SettlementDateTimeGMT": "2026-02-09T01:53:07.96",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4625272758,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 44.64,
    "SettlementValue": 44.64,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 44.64)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-02-08T09:28:18.38",
    "MachineAuthorizationTime": "2026-02-08T11:28:18.117",
    "SettlementDateTimeGMT": "2026-02-08T09:29:37.527",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4600648084,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.05,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.05)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-02-03T08:18:01.53",
    "MachineAuthorizationTime": "2026-02-03T10:18:01.143",
    "SettlementDateTimeGMT": "2026-02-03T08:18:15.617",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4600630276,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.05,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.05)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-02-03T08:07:52.03",
    "MachineAuthorizationTime": "2026-02-03T10:07:51.663",
    "SettlementDateTimeGMT": "2026-02-03T08:08:11.187",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4545673740,
    "PaymentServiceTransactionID": "260122075902",
    "PaymentServiceProviderName": "Stub Billing",
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.1,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Credit Card",
    "RecognitionMethod": "Credit Card",
    "CardNumber": "5453 xxxx xxxx 5803",
    "CardBrand": "MASTERCARD",
    "CLI": null,
    "ProductName": "Unknown(0 = 0.10)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-22T07:59:02.103",
    "MachineAuthorizationTime": "2026-01-22T09:59:02.07",
    "SettlementDateTimeGMT": "2026-01-22T08:53:02.977",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4545672122,
    "PaymentServiceTransactionID": "260122075814",
    "PaymentServiceProviderName": "Stub Billing",
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.1,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Credit Card",
    "RecognitionMethod": "Credit Card",
    "CardNumber": "5453 xxxx xxxx 5803",
    "CardBrand": "MASTERCARD",
    "CLI": null,
    "ProductName": "Unknown(0 = 0.10)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-22T07:58:14.687",
    "MachineAuthorizationTime": "2026-01-22T09:58:14.643",
    "SettlementDateTimeGMT": "2026-01-22T07:58:30.44",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4515594836,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.1,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.10)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-15T11:44:11.867",
    "MachineAuthorizationTime": "2026-01-15T13:44:11.53",
    "SettlementDateTimeGMT": "2026-01-15T11:45:58.207",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4515585818,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.05,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.05)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-15T11:40:29.583",
    "MachineAuthorizationTime": "2026-01-15T13:40:29.207",
    "SettlementDateTimeGMT": "2026-01-15T11:40:49.12",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4515573274,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.1,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.10)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-15T11:35:16.5",
    "MachineAuthorizationTime": "2026-01-15T13:35:16.15",
    "SettlementDateTimeGMT": "2026-01-15T11:36:57.857",
    "SiteID": 4,
    "SiteName": "US"
  },
  {
    "TransactionID": 4515568878,
    "PaymentServiceTransactionID": null,
    "PaymentServiceProviderName": null,
    "MachineID": 629665354,
    "MachineName": "Marshall temp- do not touch #3",
    "MachineNumber": "",
    "InstituteLocationName": null,
    "AuthorizationValue": 0.1,
    "SettlementValue": 0.1,
    "CurrencyCode": "AUD",
    "PaymentMethod": "Prepaid Credit",
    "RecognitionMethod": "Prepaid Credit",
    "CardNumber": "2736390748",
    "CardBrand": null,
    "CLI": null,
    "ProductName": "Unknown(0 = 0.10)\n",
    "MultivendTransactionBit": false,
    "MultivendNumverOfProducts": 0,
    "UnitOfMeasurement": null,
    "Quantity": 1,
    "EnergyConsumed": 0,
    "AuthorizationDateTimeGMT": "2026-01-15T11:33:23.537",
    "MachineAuthorizationTime": "2026-01-15T13:33:23.113",
    "SettlementDateTimeGMT": "2026-01-15T11:34:58.007",
    "SiteID": 4,
    "SiteName": "US"
  }
]

```

### Nayax Core

您也可以在 Nayax Core 中该机器的详情页面找到其最近销售记录，请按照以下步骤操作：

1. 访问 Operations > Machines。
2. 使用搜索功能查找该机器。
3. 从列表中选择该机器。
4. 点击 Info > Last Sales：

![](https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/getting-a-machines-last-sales-ereceipt-information/image1.png?fit=max\&auto=format\&n=27KIupf5oHU9adsO\&q=85\&s=44cf3f083a88a94e77666f14f74e07c2)

## 生成 eReceipt

要生成交易的 eReceipt，您需要使用 [Generate eReceipt](https://devzone.nayax.com/reference/zh/lynx/ereceipt/generate-ereceipt) 端点。请在请求中提供以下信息：

* TransactionID、MachineAuthorizationTime、SiteID —— 这 3 个字段的值均可通过上文提到的 Last Sales 方法检索获得
* 机器 ID
* 消费者的全名
* 消费者的电子邮件地址

您可以检索到相应机器的唯一标识符。

以下代码块展示了请求示例，使用 `DeviceSerial` 作为查询参数来过滤结果：

```sh theme={null}
curl -X 'POST' \
  'https://qa-lynx.nayax.com/operational/v1/ereceipt/generate' \
  -H 'accept: text/plain' \
  -H 'Content-Type: application/json-patch+json' \
  -d '{
  "TrasactionID": <TRANSACTION_ID>,
  "TransactionDateTime": <MACHINE_AUTHORIZATION_TIME>,
  "TrasactionSiteID": <SITE_ID>,
  "MachineID": <MACHINE_ID>,
  "FullName": "string",
  "Email": "string"
}'
```

> [!NOTE]
>
> Remember to replace `<TRANSACTION_ID>`, `<MACHINE_AUTHORIZATION_TIME>`, `<SITE_ID>`, `<MACHINE_ID>` with the actual details of the transaction.

响应中将包含所发送 eReceipt 的详细信息，包括该 PDF 的链接。

```json theme={null}
{
  "ReceiptURL": "https://nayax-ereceipt.s3.amazonaws.com/2026/02/12/YaelLawtonStubBilling/OFpQBN-x25GKRbZE8ySlnDnrO44iYVAEUKcw-vKmpoY1/ereceipt4625276436.pdf",
  "EmailSent": true,
  "EreceiptID": 6203654
}
```

### Nayax Core

您也可以在 Nayax Core 中该机器的详情页面找到其最近销售记录，请按照以下步骤操作：

1. 访问**报告 > 在线报告 > 动态交易监控器**。

![](https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/getting-a-machines-last-sales-ereceipt-information/image2.png?fit=max\&auto=format\&n=27KIupf5oHU9adsO\&q=85\&s=e613f7c8952d00bd9b78febc69c557c2)

2. 使用 Search 功能通过交易 ID 查找相关交易。

![](https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/getting-a-machines-last-sales-ereceipt-information/image3.png?fit=max\&auto=format\&n=27KIupf5oHU9adsO\&q=85\&s=2712360bae50b19aeb2db868437fa75c)

3. 从列表中选择相关交易。
4. 右键点击该交易，然后选择 Generate eReceipt：

![](https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/getting-a-machines-last-sales-ereceipt-information/image4.png?fit=max\&auto=format\&n=27KIupf5oHU9adsO\&q=85\&s=56b2e68b219036ed67a26c9d5da9575d)

5. 输入相关详细信息，然后点击 "Generate eReceipt"：

![](https://mintcdn.com/nayax-44d6e37b/27KIupf5oHU9adsO/images/docs/getting-a-machines-last-sales-ereceipt-information/image5.png?fit=max\&auto=format\&n=27KIupf5oHU9adsO\&q=85\&s=798d782894b579ff6e3d97ac31d39539)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.