Skip to main content
POST
/
v1
/
create_payment
Create Payment
curl --request POST \
  --url https://api.example.com/v1/create_payment \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "amount": 123,
  "amountCurrency": "<string>",
  "currency": "<string>",
  "orderId": "<string>",
  "description": "<string>",
  "callbackUrl": "<string>",
  "expirationMinutes": 123
}
'
{
  "success": true,
  "data": {
    "paymentId": "<string>",
    "amount": 123,
    "currency": "<string>",
    "address": "<string>",
    "invoiceUrl": "<string>",
    "qrCode": "<string>",
    "expiresAt": "<string>",
    "orderId": "<string>",
    "description": "<string>"
  },
  "message": "<string>",
  "statusCode": 123
}

Overview

This endpoint creates a payment request for a specific cryptocurrency. It generates a unique wallet address for the customer to send payment to and returns all necessary details including the payment address, amount, and invoice URL. Use this endpoint when you want the customer to pay in a specific cryptocurrency (e.g., only accept USDT_BEP20).

Authentication

X-API-Key
string
required
Your InventPay API key Example: cmfnz7jei0005p54eekx4e6mb

Request Body

amount
number
required
The payment amount in the specified amountCurrency Example: 29.99
amountCurrency
string
required
The currency of the amount field Options: USD, USDT, BTC, ETH, LTC Example: "USD"
currency
string
required
The cryptocurrency the customer will pay with Options: BTC, ETH, LTC, USDT_ERC20, USDT_BEP20 Example: "USDT_BEP20"
orderId
string
Your internal order/transaction ID for reference Example: "order-12345"
description
string
Description of the payment/product Example: "Premium Plan Subscription"
callbackUrl
string
Webhook URL to receive payment notifications Example: "https://yourapp.com/webhooks/payments"
expirationMinutes
number
Payment expiration time in minutes (5-1440) Default: 30 Example: 60

Response

success
boolean
Indicates if the request was successful
data
object
Payment details object
message
string
Success message Example: "Payment created successfully"
statusCode
number
HTTP status code Example: 200

Example Request

curl -X POST https://api.inventpay.io/v1/create_payment \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 29.99,
    "amountCurrency": "USD",
    "currency": "USDT_BEP20",
    "orderId": "order-12345",
    "description": "Premium Plan Subscription",
    "expirationMinutes": 30
  }'

Example Response

200 - Success
{
  "success": true,
  "data": {
    "paymentId": "cmh123abc456def",
    "amount": 29.99,
    "currency": "USDT_BEP20",
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "invoiceUrl": "https://inventpay.io/invoice/cmh123abc456def",
    "qrCode": "usdt_bep20:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb?amount=29.99",
    "expiresAt": "2024-01-01T12:30:00.000Z",
    "orderId": "order-12345",
    "description": "Premium Plan Subscription"
  },
  "message": "Payment created successfully",
  "statusCode": 200
}
401 - Unauthorized
{
  "success": false,
  "error": "Invalid API key",
  "statusCode": 401
}
400 - Bad Request
{
  "success": false,
  "error": "Validation failed",
  "details": {
    "currency": "Invalid currency. Must be one of: BTC, ETH, LTC, USDT_ERC20, USDT_BEP20"
  },
  "statusCode": 400
}

Error Codes

Status CodeDescription
200Payment created successfully
400Invalid request parameters
401Invalid or missing API key
429Rate limit exceeded
500Internal server error