> For the complete documentation index, see [llms.txt](https://kwpaydocs.casheer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kwpaydocs.casheer.com/direct-pay.md).

# Direct Pay

- [1. Generate Merchant Keys](https://kwpaydocs.casheer.com/direct-pay/1.-generate-merchant-keys.md): A merchant should have an RSA public key in order to integrate direct pay. The RSA key will be generated using this endpoint.
- [2. Validate Request](https://kwpaydocs.casheer.com/direct-pay/2.-validate-request.md)
- [3. Initiate Pay](https://kwpaydocs.casheer.com/direct-pay/3.-initiate-pay.md): Once the merchant request has been verified, this API is used to safely handle payment requests by encrypting card data using AES and RSA encryption.
- [4. Process Payment](https://kwpaydocs.casheer.com/direct-pay/4.-process-payment.md): Use the ProcessPayment request to initiate a payment process for a given ReferenceId.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kwpaydocs.casheer.com/direct-pay.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
