Standard Payment
Default payment allow user to pay using any network you turned on in your account settings. User will be able to choose any token available by swap providers for exchange. 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 Payment
Endpoint:
POST /payments
Request Body:
Parameter | Type | Required | Description |
---|---|---|---|
orderId | string | Yes | Unique identifier for the payment. |
fiatCurrency | string | Yes | The currency code for fiat currency (e.g., USD, EUR). |
fiatPrice | number | Yes | The amount in fiat currency. |
source | string | Yes | The source identifier for the payment. |
description | string | No | Order description. |
redirectUrl | string | No | URL that the user can use to return to your website. |
Request Example:
{
"orderId": "kitten-1",
"fiatCurrency": "USD",
"fiatPrice": 10,
"description": "white cat",
"source": "Cats store",
"redirectUrl": "on_success_redirect_url"
}
Response:
Response Field | Type | Description |
---|---|---|
paymentUrl | string | URL where the payment has been generated. |
paymentId | string | Unique identifier for the payment. |
Response Example:
{
"data": {
"paymentUrl": "https://paydefi.io/payment/{PAYMENT_ID}",
"paymentId": "{PAYMENT_ID}"
}
}
2. Get Payment Status
Retrieve the status of an existing payment.
Endpoint:
GET /payments/{payment_id};
Path Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | The unique identifier for the payment. |
Response :
Field | Type | Description |
---|---|---|
status | string | Current status of the payment. |
Response Example:
{
"status": "PENDING"
}