Create an invoice
Let’s take a look at our API reference and go through the parameters that is used in order to create the invoice:
price_amount- the payment amountprice_currency- the currency of payment, i.e. the currency into which the cryptocurrency received at the address of the invoice will be converted and in which the merchant will be credited to the balance, in our case it isEURpay_currency- the cryptocurrency in which the payment is to be made, in our case it isBTCnetwork- the blockchain in which the address is going to be created. The list of available networks can be found here.custom_id- it is recommended to specify a certain reference by which you associate your customer with the payment, e.g.209584732amount_includes_processing_fee- (bool) — indicates whether the amount includes the processing fee; can be true or false. Set this parameter totrueto charge the processing fee to the customer. Set it tofalsefor the merchant to cover the processing fee.
We have recently developed a feature called Merchant Bonus, which is available via API. This feature is optional and allows you to add a fee to the transaction amount that is credited to your balance.
merchant_bonus_typefield can be set to eitherpercentageorfixedmerchant_bonus_valuespecifies the amount to be added to the transaction based on the selected type.
Here's the invoice request example:
{
"price_amount": "10.0",
"price_currency": "EUR",
"pay_currency": "SOL",
"amount_includes_processing_fee": "true",
"custom_id": "Custom-ID-123",
"customer_id":"CUSTOMER-123",
"merchant_bonus_type": "percentage",
"merchant_bonus_value": "2.0",
"description": "Invoice1",
"metadata": {
"property1": "string",
"property2": "string"
},
"success_redirect_url": "https://example.com",
"unsuccess_redirect_url": "https://example.com",
"payer_email": "user@cryptopay.me"
}You will receive the invoice address, the amount of cryptocurrency to be sent to the invoice address and a link to the invoice's hosted page, which can be built into your website and other details:
Last updated