Restricted Payment
Restricted payment is payment where chain & token already preselected and not available for user to change.
Restricted payment use chain and token you send in /payment
request body instead of your settings.
When payment completed you will receive USDC to your wallet. (Any other token except USDC will be exchanged to USDC before transferring to your wallet)
1. Create a Restricted Payment
Endpoint
POST /payments
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
orderId | string | Yes | A unique identifier for the payment transaction. |
fiatCurrency | string | Yes | The fiat currency code (e.g., USD, EUR) used for the transaction. |
fiatPrice | number | Yes | The amount in fiat currency that needs to be paid. |
source | string | Yes | The source or origin of the payment request (e.g., store name). |
description | string | No | A brief description of the order being paid for. |
redirectUrl | string | No | The URL to redirect the user after a successful payment. |
tokenAddress | string | Yes | The smart contract address of the token used for the payment. |
chainId | number | Yes | The blockchain network ID where the token operates. |
Request Example
{
"orderId": "kitten-1",
"fiatCurrency": "USD",
"fiatPrice": 10,
"source": "Cats store",
"description": "White cat",
"redirectUrl": "on_success_redirect_url",
"chainId": 1,
"tokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
}
Response
Field | Type | Description |
---|---|---|
paymentUrl | string | The URL where the payment transaction has been generated. |
paymentId | string | A unique identifier assigned to the payment. |
Response Example
{
"data": {
"paymentUrl": "https://paydefi.io/payment/{PAYMENT_ID}",
"paymentId": "{PAYMENT_ID}"
}
}
2. Support Networks
This endpoint retrieves a list of supported blockchain networks and their corresponding IDs.
Endpoint
GET /chain-config/chains
Response
Network ID | Name |
---|---|
1 | Ethereum (ETH) |
10 | Optimism |
56 | Binance Smart Chain (BSC) |
137 | Polygon |
9000 | Solana |
42161 | Arbitrum |
43114 | Avalanche C-Chain |
Response Example
[
"1",
"10",
"56",
"137",
"9000",
"42161",
"43114"
]
3. Support Tokens
This endpoint retrieves the list of available tokens for a specific blockchain network.
Endpoint
GET /chain-config/tokens?chainId={chainId}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
chainId | number | Yes | The blockchain network ID for which tokens should be retrieved. |
Request Example
GET /chain-config/tokens?chainId=1
Response
Field | Type | Description |
---|---|---|
symbol | string | The ticker symbol of the token (e.g., ETH, USDC). |
name | string | The full name of the token. |
decimals | number | The number of decimal places the token supports. |
address | string | The smart contract address of the token. |
chainId | number | The blockchain network ID where the token is available. |
logoURI | string | A URL pointing to the token's logo image. |
Response Example
[
{
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"chainId": 1,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
},
{
"symbol": "1INCH",
"name": "1Inch",
"decimals": 18,
"address": "0x111111111117dc0aa78b770fa6a738034120c302",
"chainId": 1,
"logoURI": "https://gemini.com/images/currencies/icons/default/1inch.svg"
},
{
"symbol": "AAVE",
"name": "AaveToken",
"decimals": 18,
"address": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
"chainId": 1,
"logoURI": "https://gemini.com/images/currencies/icons/default/aave.svg"
}
]