TokenOS
  • Overview
    • Introduction
    • Authentication
    • User & Wallet Identification
    • Errors
    • Versioning
  • Guides
    • How our system works
    • Rewarding your audience
      • In exchange for completing an incentive
      • In exchange for your own points
      • As a credit
  • Wallet API
    • Balances
    • Allocations
  • Management API
    • Token Selection
    • Campaigns
    • Subscriptions
    • Codes
  • Payments API
    • Introduction
    • Payments
    • Deliveries
    • Relayer
Powered by GitBook
On this page
  1. Payments API

Payments

PreviousIntroductionNextDeliveries

Last updated 2 years ago

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.

If you are using your own ERC20 contract, you MUST implement ERC20 Permit in order to use the TokenOS Payments API.

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

  • Use our returned parameters to ask your user to sign a permit

  • Post back the permit

  • Poll the payment request for its status, or be notified by web hook

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.

Get a payment request information and status

get
Authorizations
Path parameters
requestIdstringRequired
Responses
200
Payment request information
application/json
Responseobject
get
GET /v1/payments/{requestId} HTTP/1.1
Host: localhost:8080
Accept: */*
200

Payment request information

{}
  • ERC20 Permit
  • POSTCreate a new payment request
  • GETGet a payment request information and status
  • Conversion Rate

Create a new payment request

post
Authorizations
Body
objectOptional
Responses
200
Created
application/json
Responseobject
post
POST /v1/payments HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
200

Created

{}