> For the complete documentation index, see [llms.txt](https://docs.enoxswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enoxswap.com/products/pay.md). Agents can also search and read this documentation through its [MCP server](https://docs.enoxswap.com/~gitbook/mcp).

# Pay and Donate

**EnoxSwap Pay** is a crypto checkout built on the aggregator. A customer can pay with **whatever token they hold**; the merchant receives **the token they want**. Use the builder at **`/embed-pay`** to create a Pay or Donate button.

![EnoxSwap Pay flow](https://1273857689-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9EGjsXxqcGhGQ6XWd4Uo%2Fuploads%2Fgit-blob-a50e16b4bddafafaa20914a5263d750d7664be67%2Fpayment-flow.png?alt=media)

## Two payment modes

| Mode           | Function      | What happens                                                                                                                                      |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| Swap payment   | `pay()`       | The customer pays token A. The PaymentRouter swaps it through EnoxSwap and forwards the output (token B) to the merchant in the same transaction. |
| Direct payment | `payDirect()` | The customer pays the exact token the merchant wants. No swap - a plain forwarded transfer.                                                       |

Every payment emits an event that carries the merchant's `orderId`. That event is what the [verify-payment API](https://docs.enoxswap.com/developers/verify-payment-api.md) reads to confirm an order was paid.

## Checkout URL parameters

The hosted checkout lives at `https://enoxswap.com/pay`.

| Parameter         | Description                                                                                    |
| ----------------- | ---------------------------------------------------------------------------------------------- |
| `merchant`        | Address that should receive the funds.                                                         |
| `tokenOut`        | Token the merchant wants to receive.                                                           |
| `chain`           | Chain ID.                                                                                      |
| `amountOut`       | Fixed amount the merchant must receive (fixed-price mode).                                     |
| `suggestedAmount` | Suggested amount for donate mode.                                                              |
| `order`           | The merchant's own order ID (plain string).                                                    |
| `referrer`        | Optional referral address.                                                                     |
| `callback`        | URL the customer is redirected to after paying. The page adds `order`, `tx` and `chain` to it. |
| `theme`           | `dark` or `light`.                                                                             |

## Embedding

You can open the checkout as a button/popup, or embed it inline:

```html
<iframe
  id="enoxswap-pay"
  src="https://enoxswap.com/pay?merchant=0x...&tokenOut=0x...&chain=56&amountOut=25&order=ORDER-1234"
  width="420"
  height="420"
  scrolling="no"
  style="border:none;border-radius:24px;overflow:hidden;width:100%;max-width:420px;"
></iframe>
```

## Confirming a payment (merchant side)

Never trust the browser redirect alone. After the customer returns with a transaction hash, call the [verify-payment API](https://docs.enoxswap.com/developers/verify-payment-api.md) from your **server** before marking the order as paid.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.enoxswap.com/products/pay.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
