Invoices
Request a payment from your clients: set amount, currency and time limits.
Creating an invoice
In order to create an invoice, you'll need to send a request to 0xpay API with a specific set of parameters. Depending on your bussiness' needs, invoices can be created in 2 ways:
Server-side creation
Requires authorization to send request.
Invoice parameters need to be defined in the request body.
Returns a URL to invoice webpage, hosted by 0xpay.
Сlient-side creation (via Web Form)
No authorization required (
merchantID
parameter is used for these purposes).Invoice parameters are defined in the HTML web form.
In response, user will be redirected to the payment webpage URL.
As a result, user will see a webpage with invoice details: name of the company, expiration timer, payment amount and currency, as well as further instructions. After the user inputs his email address (which can be also filled through API request) and confirms payment, he has to pay the amount due before the timer expires.
After the payment is sent, you will receive callback notifications on each invoice status update.
Note: paid
amount can be less then amount in case of underpayment and more then amount in case of overpayment
If the user fails to send full amount before the timer expires - invoice will be closed with status "Expired". Simultaneously, user will receive a letter with instructions on how to get a refund for his payment.
However, if the user manages to send more funds than necessary, invoice will be closed with a "Paid" status. In order to account for overpayments, you can compare data in the fieldamount
with paidAmount
from the callback notification.
Example: If you create an invoice for 1000 USDT, the user will be able to send several smaller transactions (4x250 USDT) while the invoice is still active. However, if the user sent 1500 USDT to the invoice address,paidAmount="1500"
would be displayed in notification.
Invoice Types
Just as with the other API operations, we divide invoices in 2 specific groups, depending on the chosen payment currency.
Cryptocurrency Invoices | Fiat Invoices | |
---|---|---|
API Method | ||
Time Limit | 72 hours | No time limit |
Supported Payment Methods | ||
Pay in installments | ✅ Users can send multiple tx's to pay for the invoice | 🔴 Single payment only |
Last updated