> ## 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.

# 申请退款

export const EndpointCard = ({method = "API", title, children, href, arrow = true}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-green-400/20 dark:mint-bg-green-400/20",
      text: "mint-text-green-700 dark:mint-text-green-400",
      border: "mint-border-green-300 dark:mint-border-green-700"
    },
    POST: {
      bg: "mint-bg-blue-400/20 dark:mint-bg-blue-400/20",
      text: "mint-text-blue-700 dark:mint-text-blue-400"
    },
    PUT: {
      bg: "mint-bg-yellow-400/20 dark:mint-bg-yellow-400/20",
      text: "mint-text-yellow-700 dark:mint-text-yellow-400"
    },
    PATCH: {
      bg: "mint-bg-orange-400/20 dark:mint-bg-orange-400/20",
      text: "mint-text-orange-700 dark:mint-text-orange-400"
    },
    DELETE: {
      bg: "mint-bg-red-400/20 dark:mint-bg-red-400/20",
      text: "mint-text-red-700 dark:mint-text-red-400"
    },
    API: {
      bg: "mint-bg-black",
      text: "mint-text-white"
    }
  };
  const MethodBadge = ({method}) => {
    const style = METHOD_STYLES[method?.toUpperCase()] ?? METHOD_STYLES.GET;
    return <span className={`
          method-pill rounded-lg font-bold px-1.5 py-0.5 text-xs leading-5 ${style.bg} ${style.text}`}>
        {method?.toUpperCase()}
      </span>;
  };
  const content = <div className="group flex items-center gap-4 border border-gray-200 dark:border-gray-700 rounded-xl p-5 bg-white dark:bg-[#1e1e1e] hover:border-gray-400 dark:hover:border-gray-500 hover:shadow-md transition-all cursor-pointer">
      {}
      <div className="flex-1 min-w-0">
        <p className="font-semibold text-gray-900 dark:text-white text-sm leading-snug">{title}</p>
        {children && <p className="mt-1 text-sm text-gray-500 dark:text-gray-400 line-clamp-2">{children}</p>}
      </div>

      {}
      <div className="shrink-0">
        <MethodBadge method={method} />
      </div>
    </div>;
  if (!href) return content;
  return <a href={href} className="block no-underline border-b-0 mb-2">
      {content}
    </a>;
};

退款流程始于提交退款申请，申请中包含退款金额和原因等详细信息。这将通知客户退款正在处理中。我们将在本页面更详细地描述此流程。

<Warning>
  仅限信用卡

  只有通过信用卡进行的交易才能申请退款。预付卡交易不适用此选项。
</Warning>

在 Nayax Core 中，您可以通过**动态交易监控器**申请退款。请按照以下步骤操作。

1. 访问**报告 > 在线报告 > 动态交易监控器**。
2. 搜索要退款的交易。您可以使用筛选功能来简化操作。
3. 右键单击您想要退款的交易。
4. 点击**申请退款**

   <Frame>
     <img src="https://mintcdn.com/nayax-44d6e37b/SZdrogZN6xHGu-sq/images/docs/request-refunds/image1.png?fit=max&auto=format&n=SZdrogZN6xHGu-sq&q=85&s=623aab1fa18dc27fdc03c6c8609e9785" width="1920" height="910" data-path="images/docs/request-refunds/image1.png" />
   </Frame>
5. 将会弹出一个窗口。在其中，选择全部退款还是部分退款，并填写退款原因。
6. 点击**申请退款**。

   <Frame>
     <img src="https://mintcdn.com/nayax-44d6e37b/SZdrogZN6xHGu-sq/images/docs/request-refunds/image2.png?fit=max&auto=format&n=SZdrogZN6xHGu-sq&q=85&s=7d9c1c827f3c71eded33d65ca0c6716f" width="1920" height="910" data-path="images/docs/request-refunds/image2.png" />
   </Frame>

## Lynx API

此过程可以通过 Lynx API 以编程方式执行。以下端点用于处理退款。

<EndpointCard title="申请退款" href="/reference/lynx/payment/request-a-payment-refund" method="post" />

<Warning>
  验证

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

### 发起请求

要启动请求，请使用[“请求退款”](/reference/lynx/payment/request-a-payment-refund)端点申请退款。在请求的正文参数中提供与退款相关的属性，如下所示：

```sh Request theme={null}
curl --request POST \
     --url https://qa-lynx.nayax.com/operational/v1/payment/refund-request \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "RefundAmount": 0,
  "RefundEmailList": "string",
  "RefundReason": "string",
  "TransactionId": 0,
  "SiteId": 0,
  "MachineAuTime": "2024-10-10T16:30:37.179Z"
}
'
```

下面，您可以看到每个参数的描述：

| 姓名 | 类型 | 描述 |
| :- | :- | :- |
| 退款金额 | `double / null` | 退还给客户的金额。 |
| RefundEmailList | `string / null` | 用于通知退款的电子邮件地址列表，以逗号分隔。 |
| 退款原因 | `string / null` | 要求退款的原因。 |
| 交易ID | `int64` | 请求退款的交易的唯一标识符。 |
| 站点编号 | `int32` | 发生交易的站点的唯一标识符。 |
| 机器AuTime | `date-time` | 机器的授权时间与交易相关联。 |

### 如何获取TransactionID和SiteID

Retrieve `TransactionId` and `SiteId` from the Lynx API using the [Get Last Sales for Machine](/reference/lynx/machines/get-last-sales-for-machine-by-machineid) endpoint with the `MachineID`. The response object includes both values.

## 请求状态

一旦您发送请求，通知电子邮件将会发送到请求参数中输入的电子邮件地址。

该退款现处于 `pending`（待处理）状态，需要被批准或拒绝。详情请参阅 [Approve or Decline a Refund](/docs/manage-data-operations/lynx-api/refunds/approve-or-decline-a-refund)。


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