Create an invoice
Generate a cryptocurrency invoice for a customer order. Specify the order details, amount (in fiat or crypto), currency, and optional settings like expiration time or error tolerance for payments. The API calculates the crypto amount if you provide fiat, or vice versa using current rates.
Endpoint
POST /invoices
Request Body Parameters
Parameter | Type | Required | Description | Example Value | Notes |
---|---|---|---|---|---|
order_id | string | Yes | Unique identifier for your order | "order-12345" | Must be unique for each order |
fiat_amount | number (double) | No | Amount in fiat currency | 100.50 | Minimum 0; provide this or crypto_amount, not both |
fiat_currency | string | No | Fiat currency code | "EUR" | Only EUR supported at the moment |
crypto_amount | number (double) | No | Amount in cryptocurrency | 0.005 | Minimum 0; provide this or fiat_amount |
currency | string | Yes | Cryptocurrency code | "BTC" | Must be a supported currency (check /currencies) |
allowed_error_percent | integer | No | Allowed payment error percentage | 5 | 0-100; defaults to system value if omitted |
order_name | string | No | Descriptive name for the order | "Premium Subscription" | For reference |
expire_min | integer | No | Expiration time in minutes | 30 | Minimum 15; defaults if omitted |
callback_url | string | No | URL for status update webhooks | "https://your-site.com/callback" | Must be a valid URI |
cURL Example
curl -X POST https://api.itispay.com/api/v1/invoices \
-H "Api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "order-12345",
"fiat_amount": 100.50,
"fiat_currency": "EUR",
"currency": "BTC",
"allowed_error_percent": 5,
"order_name": "Premium Subscription",
"expire_min": 30,
"callback_url": "https://your-site.com/callback"
}'
Response
- Successfull response: 201 Created: Returns the full invoice details (see Invoice Structure below).
- Errors: 400 (invalid body), 401 (unauthorized), 422 (validation, e.g., missing required fields).
Updated 18 days ago