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

ParameterTypeRequiredDescriptionExample ValueNotes
order_idstringYesUnique identifier for your order"order-12345"Must be unique for each order
fiat_amountnumber (double)NoAmount in fiat currency100.50Minimum 0; provide this or crypto_amount, not both
fiat_currencystringNoFiat currency code"EUR"Only EUR supported at the moment
crypto_amountnumber (double)NoAmount in cryptocurrency0.005Minimum 0; provide this or fiat_amount
currencystringYesCryptocurrency code"BTC"Must be a supported currency (check /currencies)
allowed_error_percentintegerNoAllowed payment error percentage50-100; defaults to system value if omitted
order_namestringNoDescriptive name for the order"Premium Subscription"For reference
expire_minintegerNoExpiration time in minutes30Minimum 15; defaults if omitted
callback_urlstringNoURL 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).