Documentation
Integration Guide
Payments
Standard Payment

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:

ParameterTypeRequiredDescription
orderIdstringYesUnique identifier for the payment.
fiatCurrencystringYesThe currency code for fiat currency (e.g., USD, EUR).
fiatPricenumberYesThe amount in fiat currency.
sourcestringYesThe source identifier for the payment.
descriptionstringNoOrder description.
redirectUrlstringNoURL 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 FieldTypeDescription
paymentUrlstringURL where the payment has been generated.
paymentIdstringUnique 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:

ParameterTypeRequiredDescription
idstringYesThe unique identifier for the payment.

Response :

FieldTypeDescription
statusstringCurrent status of the payment.

Response Example:

{
  "status": "PENDING"
}