Create an invoice

Creates an invoice payable in the chosen coin and network.

POST/invoices

System information

API key
Required
Rate limit
20 requests per minute

Body parameters

ParameterTypeRequiredDescription
coinCodestringYesCryptocurrency code, for example USDT.
networkCodestringYesBlockchain network code, for example tron.
amountstringYesFiat payment amount. At most 2 decimals.
currencystringNoFiat currency of the amount: USD, EUR, RUB. Default USD.
orderIdstringNoYour order ID. Used for idempotency within the project.
descriptionstringNoPayment description.
curl -X POST "https://api.atomic.wallet/api/v1/invoices" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "coinCode": "USDT",
  "networkCode": "tron",
  "amount": "100.00",
  "currency": "USD",
  "orderId": "order-1001",
  "description": "Order payment"
}'
{
  "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "projectUuid": "73e68013-32f0-4248-95ac-46aed61e59b0",
  "coinCode": "USDT",
  "networkCode": "tron",
  "coinName": "Tether USD",
  "networkName": "TRON",
  "networkPrefix": "TRC-20",
  "amount": "100.000000",
  "sourceAmount": "100.00",
  "sourceCurrency": "USD",
  "sourceRate": "1.000000",
  "status": "pending",
  "confirmedAmount": "0.000000",
  "unconfirmedAmount": "0.000000",
  "remainingAmount": "100.000000",
  "overpaidAmount": "0.000000"
}

Response fields

ParameterTypeDescription
uuidstringInvoice UUID.
projectUuidstringProject UUID.
coinCodestringCryptocurrency code.
networkCodestringBlockchain network code.
coinNamestringCryptocurrency name.
networkNamestringNetwork name.
networkPrefixstringToken standard in the network, for example TRC-20.
amountstringAmount to pay in cryptocurrency.
sourceAmountstringInvoice amount in the source currency.
sourceCurrencystringInvoice source currency.
sourceRatestringConversion rate from the source currency to cryptocurrency.
statusstringInvoice status, see “Statuses”.
confirmedAmountstringPaid and confirmed amount.
unconfirmedAmountstringReceived but not yet confirmed amount.
remainingAmountstringAmount left to pay.
overpaidAmountstringOverpaid amount.

Idempotency

SituationResult
Same orderId and same payloadThe existing invoice is returned.
Same orderId, different payload409 INVOICE_EXTERNAL_ID_CONFLICT
No orderIdEvery POST creates a new invoice.
429 INVOICE_CREATION_RATE_LIMITEDLimit: 20 invoices per 60 seconds per project.
500 or timeoutThe outcome is unknown: retry only with the same orderId and keep the requestId.

Possible errors

HTTPCodeDescription
400INVOICE_COIN_UNAVAILABLEThe coin is not available for invoices.
400INVOICE_AMOUNT_INVALIDInvalid invoice amount.
400INVOICE_AMOUNT_BELOW_MINIMUMThe amount is below the minimum.
400INVOICE_AMOUNT_ABOVE_MAXIMUMThe amount is above the maximum.
400INVOICE_DESCRIPTION_INVALIDInvalid invoice description.
400INVOICE_RATE_UNAVAILABLENo rate available for the coin.
400INVOICE_ADDRESS_GENERATION_FAILEDFailed to generate the invoice address.
400VALIDATION_FAILEDRequest parameters failed validation.
409INVOICE_EXTERNAL_ID_CONFLICTorderId is already used with different invoice parameters.
429INVOICE_CREATION_RATE_LIMITEDInvoice creation rate limit exceeded.