Crypto Invoices
Every request listed on this page requires authorization to be successfully completed.
Create crypto invoice (server-side)
POST
https://public.api.0xpay.app/merchants/invoices/crypto
Returns a webpage URL on 0xpay.app domain for one-time payment.
Important note: crypto invoices will expire after 72 hours. However, the time displayed on payment page is 48 hours. Additional time is given to lower the risk of expiration in case of network delays.
Status Updates: Every invoice update will produce an invoice notification.
Request Body
Name | Type | Description |
---|---|---|
amount | object |
|
description | string | descriptional field, will be shown to the user on invoice page |
meta | string | your metadata that will be passed along to you later with a notification |
name* | string | descriptional field, name of your invoice. For example: "Order payment" |
baseAmount | object | If specified
|
duration | number | the lifetime of crypto invoice in ms. Default: 72 hours |
clientDuration | number | the lifetime of crypto invoice in ms on the frontend. Default: |
toPendingImmediate | boolean | jump immediately to pending status, it can be useful if you want to skip fist "user prompt" status. |
string | user email | |
target | object |
|
redirectUrl | string | URL to redirect user after payment |
Create crypto invoice via web form (client-side)
POST
https://public.api.0xpay.app/merchants/invoices/crypto/form
Creates a cryptocurrency invoice using parameters from your HTML form defined defined parameters and redirects users to 0xpay URL for payment. on 0xpay.app domain for one-time payment. Instead of authorizing a request, just pass your merchantID along with other parameters.
Expiration time: 72 hours for crypto. However, the time displayed on payment page is 48 hours. Additional time is given to lower the risk of expiration in case of network delays.
Status Updates: Every invoice update will produce an invoice notification.
Request Body
Name | Type | Description |
---|---|---|
baseValue | string | If specified will be converted to the |
description | string | descriptional field, will be shown to the user on invoice page |
meta | string | your metadata that will be passed along to you later with a notification |
name* | string | descriptional field, name of your invoice. For example: "Order payment" |
merchantId* | string | internal id of your 0xpay merchant account |
value | string | invoice amount you want to receive from the user, this value is optional if |
ticker | string | find values using "List all supported assets" request |
baseTicker | string | only fiat tickers are supported now, available values: "UAH", "USD", "EUR" |
blockchain | string | available values you can find here ("API value" column) This field is optional, if not specified user will fill this fields on his demand |
targetTicker | string | the currency to which we will try to exchange the received funds if |
targetAddress | string | the address, to which we will withdraw invoice funds in the currency specified in |
targetBlockchain | string | network in which withdrawal will be made, this field is required if |
redirectUrl | string | URL to redirect user after payment |
Redirects to payment webpage URL
Crypto invoice web form example:
Find crypto invoice details by ID
GET
https://public.api.0xpay.app/merchants/invoices/crypto/:id
This method is used to get invoice's data by it's id.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | internal identificator of 0xpay invoice |
When fetching an invoice, it can come with different status that can be equal to: | 1. CREATED 2. REGISTERED (address allocated) 3. PENDING (1 deposit at least catched) 4. PAID 5. EXPIRED (ran out of timeout)
Close invoice
POST
https://public.api.0xpay.app/merchants/invoices/crypto/:id/close
Close invoice on-demand. For example: the user paid half of the invoice amount and you want to close it before the full payment
The invoice will be immediately transferred to the "PAID" status
Last updated