Crypto Invoices
Last updated
Last updated
Every request listed on this page requires authorization to be successfully completed.
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.
Name | Type | Description |
---|---|---|
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.
Redirects to payment webpage URL
Crypto invoice web form example:
GET
https://public.api.0xpay.app/merchants/invoices/crypto/:id
This method is used to get invoice's data by it's id.
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)
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
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
amount
object
value: string
– invoice amount you want to receive from user, this value is optional if baseAmount
provided
ticker: string
– find values using "List all supported assets" request
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
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 baseAmount.value
will be converted to the amount
after a user clicks the "Continue" button on the invoice page. Useful when you want to bill your user with fiat assets but pay an invoice in crypto.
value: string
– invoice amount you want to receive from the user
ticker: string
– only fiat tickers supported now, available values: "UAH", "USD", "EUR"
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: duration
/ 2
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
ticker: string
- the currency to which we will try to exchange the received funds if target.ticker == amount.ticker
no exchange will happen
address: string
- the address, to which we will withdraw invoice funds in the currency specified in target.ticker
blockchain: string
- network in which withdrawal will be made, this field is required if target.address
is provided, available values you can find here ("API value" column)
redirectUrl
string
URL to redirect user after payment
baseValue
string
If specified will be converted to the value
after a user clicks the "Continue" button on the invoice page. Useful when you want to bill your user with fiat assets but pay an invoice in crypto.
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 baseValue
provided
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 targetTicker == ticker
no exchange will happen
targetAddress
string
the address, to which we will withdraw invoice funds in the currency specified in targetTicker
targetBlockchain
string
network in which withdrawal will be made, this field is required if targetAddress
is provided, available values you can find here ("API value" column)
redirectUrl
string
URL to redirect user after payment
id*
string
internal identificator of 0xpay invoice