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
Your InventPay API key Example: cmfnz7jei0005p54eekx4e6mb
Request Body
The payment amount in the specified amountCurrency Example: 29.99
The currency of the amount field Options: USD, USDT, BTC, ETH,
LTC Example: "USD"
The cryptocurrency the customer will pay with Options: BTC, ETH,
LTC, USDT_ERC20, USDT_BEP20 Example: "USDT_BEP20"
Your internal order/transaction ID for reference Example: "order-12345"
Description of the payment/product Example: "Premium Plan Subscription"
Webhook URL to receive payment notifications Example:
"https://yourapp.com/webhooks/payments"
Payment expiration time in minutes (5-1440) Default: 30 Example:
60
Response
Indicates if the request was successful
Payment details object Unique identifier for this payment Example: "cmh123abc..."
Payment amount in the specified cryptocurrency Example: 29.99
The cryptocurrency for this payment Example: "USDT_BEP20"
Unique wallet address for this payment Example:
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Hosted payment page URL Example:
"https://inventpay.io/invoice/cmh123..."
QR code data for payment Example:
"usdt_bep20:0x742d35Cc...?amount=29.99"
Payment expiration timestamp (ISO 8601) Example:
"2024-01-01T12:00:00.000Z"
Your order ID (if provided) Example: "order-12345"
Payment description (if provided)
Success message Example: "Payment created successfully"
HTTP status code Example: 200
Example Request
cURL
JavaScript/TypeScript
Python
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
{
"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
}
{
"success" : false ,
"error" : "Invalid API key" ,
"statusCode" : 401
}
{
"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 Code Description
200 Payment created successfully 400 Invalid request parameters 401 Invalid or missing API key 429 Rate limit exceeded 500 Internal server error