> For the complete documentation index, see [llms.txt](https://p00ls.gitbook.io/token-os/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://p00ls.gitbook.io/token-os/payments-api/payments.md).

# Payments

This API can be used to initiate and manage payment requests for your own $TOKEN, allowing you to seamlessly accept payments from users.

### ERC20 Permit

This feature relies on the ERC20 Permit extension.  ERC20 Permit is an extension to the ERC20 token standard that allows users to pre-approve a token transfer that anyone can execute on their behalf.

{% hint style="info" %}
If you are using your own ERC20 contract, you **MUST** implement ERC20 Permit in order to use the TokenOS Payments API.
{% endhint %}

In order for the end user to sign the permit with their wallet, you will need to implement the following flow within your application:

* Create a payment request&#x20;
* Use our returned parameters to ask your user to sign a permit
* Post back the permit&#x20;
* Poll the payment request for its status, or be notified by web hook

{% openapi src="/files/4t8BCIfLXQH1RwD6kaEf" path="/payments" method="post" %}
[payment-api.yaml](https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FeMLXfUneO8e88VmJxNsa%2Fpayment-api.yaml?alt=media\&token=dc57db6b-734f-4ae1-9583-af480d989048)
{% endopenapi %}

{% openapi src="/files/4t8BCIfLXQH1RwD6kaEf" path="/payments/{requestId}" method="get" %}
[payment-api.yaml](https://2025772754-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKOyoBDhx8ymvd9xgu92d%2Fuploads%2FeMLXfUneO8e88VmJxNsa%2Fpayment-api.yaml?alt=media\&token=dc57db6b-734f-4ae1-9583-af480d989048)
{% endopenapi %}

### Conversion Rate

If you have an existing points program, you'll likely establish a fixed or variable conversion rate from your own points to your own $TOKEN.

Payment requests can also save a conversion rate. This feature allows you to atomically create a payment request and retain a conversion rate that you have computed on your end.

This can be especially useful if you need to lock in a specific exchange rate for a particular transaction.


---

# 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://p00ls.gitbook.io/token-os/payments-api/payments.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.
