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