Create an invoice

Creates a new invoice.

POST https://api.silus.io/v1/invoices

Request body

Name
Type
Default
Definition

amount*

string

Amount to be paid.

If there are pennies in the amount, then send them with a separator '.'

Example: 10.28

fiat_currency*

string

Fiat currency ISO 4217 code. List of supported fiat currencies

order_id*

string min: 1 max: 255 alpha_dash

Order identifier from your system.

We will send this ID in every webhook request. ⚠️ The order_id must be unique within the merchant invoices. When we find an existing invoice with order_id, we return its details, a new invoice will not be created.

is_payment_multiple

boolean

true

lifetime

int min: 300 max: 43200

3600

The lifespan of the issued invoice (in seconds)

accuracy_payment_percent

numeric min: 0 max: 5

0

Acceptable inaccuracy in payment.

For example, if you pass the value 5, the invoice will be marked as Paid even if the client has paid only 95% of the amount.

The actual payment amount will be credited to the balance

webhook_url

nullable string url

null

In case you need to have a custom webhook url for that specific order. It has higher priority than the one set in project settings

return_url

nullable string url

null

In case you need to have a custom return url for that specific order. It has higher priority than the one set in project settings

success_url

nullable string url

null

In case you need to have a custom success url for that specific order. It has higher priority than the one set in project settings

additional_data

nullable array|object max: 255 KB

null

You can send any additional data with this request, it will be returned to you with the webhook. user_id field is reserved and value from this field will be displayed in the backoffice.

* - mandatory parameter

Request example

Below is a simple example with the minimum required number of parameters. In this case, an invoice will be created with the fiat currency USD. On the payment page, the user will be able to select the cryptocurrency and network to pay the bill.

curl https://api.silus.io/v1/invoices
\-X POST
\-H 'Authorization: Bearer superSecretPrivateKey'
\-H 'Content-Type: application/json'
\-d '{	"amount": "15",	"fiat_currency": "USD",	"order_id": "1",}'

Response

{
  "id": "9c3288f5-3aef-464d-a3fd-57c170163eab",
  "amount": 9,
  "crypto_amount": 0.0001855328,
  "remaining_crypto_amount": 0.0001855328,
  "paid_fiat_amount": 0,
  "paid_crypto_amount": 0,
  "fiat_currency": "USD",
  "is_payment_multiple": true,
  "status": "pending",
  "currency": "BTC",
  "network": "BTC",
  "wallet": "bc1qkyuvunrr4h393vvjkn5w9pyljdnu6084v5tr6j",
  "created_at": 1717408600,
  "expires_at": 1717412200,
  "pay_url": "https://pay.silus.io/9c3288f5-3aef-464d-a3fd-57c170163eab"
}
Parameter
Description

id*

Invoice id. Can be used to check it's status

amount*

Invoice amount in fiat currency

crypto_amount

Invoice amount in crypto. Can be null in case no strict currency/network provided

remaining_crypto_amount

Invoice remaining amount in crypto. Can be null in case no strict currency/network provided

paid_fiat_amount

Paid amount of the invoice in fiat currency

paid_crypto_amount

Paid amount of the invoice in crypto currency

fiat_currency*

Fiat currency from which order was created

is_payment_multiple

Whentether multiple payments are allowed for this invoice

wallet

Wallet where we're expecting the payment to be. Can be omit in case no payment method selected

created_at

Unix time for invoice creation date

expires_at

Unix time for invoice expiration date

pay_url

Link which can be used to redirect user to our payment form

* - mandatory parameter

Last updated