Skip to main content
POST
/
v1
/
create_invoice
Create Invoice
curl --request POST \
  --url https://api.example.com/v1/create_invoice \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "amount": 123,
  "amountCurrency": "<string>",
  "orderId": "<string>",
  "description": "<string>",
  "expirationMinutes": 123
}
'
{
  "success": true,
  "data": {
    "paymentId": "<string>",
    "baseAmount": 123,
    "baseCurrency": "<string>",
    "conversionRates": {
      "BTC": {
        "cryptoAmount": 123,
        "price": 123
      },
      "ETH": {},
      "LTC": {},
      "USDT_ERC20": {},
      "USDT_BEP20": {}
    },
    "invoiceUrl": "<string>",
    "allowCurrencySelection": true,
    "orderId": "<string>",
    "expiresAt": "<string>"
  },
  "message": "<string>",
  "statusCode": 123
}

Overview

This endpoint creates a multi-currency invoice that allows customers to choose which cryptocurrency they want to pay with. The invoice displays conversion rates for all supported cryptocurrencies. Use this endpoint when you want to give customers flexibility in choosing their payment method.

Authentication

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

Request Body

amount
number
required
The invoice amount in the specified amountCurrency Example: 49.99
amountCurrency
string
required
The currency of the amount field Options: USD, USDT Example: "USD"
orderId
string
Your internal order/transaction ID for reference Example: "order-67890"
description
string
Description of the payment/product Example: "E-commerce Purchase"
expirationMinutes
number
Invoice expiration time in minutes (5-1440) Default: 60 Example: 60

Response

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

Example Request

curl -X POST https://api.inventpay.io/v1/create_invoice \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 49.99,
    "amountCurrency": "USD",
    "orderId": "order-67890",
    "description": "E-commerce Purchase",
    "expirationMinutes": 60
  }'

Example Response

200 - Success
{
  "success": true,
  "data": {
    "paymentId": "cmh456def789ghi",
    "baseAmount": 49.99,
    "baseCurrency": "USDT",
    "conversionRates": {
      "BTC": {
        "cryptoAmount": 0.0012,
        "price": 41500
      },
      "ETH": {
        "cryptoAmount": 0.032,
        "price": 3200
      },
      "LTC": {
        "cryptoAmount": 0.85,
        "price": 75
      },
      "USDT_ERC20": {
        "cryptoAmount": 49.99,
        "price": 1
      },
      "USDT_BEP20": {
        "cryptoAmount": 49.99,
        "price": 1
      }
    },
    "invoiceUrl": "https://inventpay.io/invoice/cmh456def789ghi",
    "allowCurrencySelection": true,
    "orderId": "order-67890",
    "expiresAt": "2024-01-01T13:00:00.000Z"
  },
  "message": "Invoice created successfully",
  "statusCode": 200
}
401 - Unauthorized
{
  "success": false,
  "error": "Invalid API key",
  "statusCode": 401
}
400 - Bad Request
{
  "success": false,
  "error": "Validation failed",
  "details": {
    "amount": "Amount must be greater than 0"
  },
  "statusCode": 400
}

Error Codes

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