Skip to content

Create Payment Invoice

Submission URL: https://openapi.basicex.com/v2/invoices

Request Method: POST

Content-Type: application/json

Request Parameters

ParameterRequiredTypeDescription
buyerIdNostringMerchant-side customer identification number, used to identify the customer ID of the merchant side that paid the invoice
orderIdYesstringInternal order number on the merchant side, which must be unique within the same merchant, used to associate the payment invoice with the merchant order ID
fiatNostringBasicEx will convert to the corresponding amount of all cryptocurrencies based on this fiat currency, which can be selected by the customer for payment. If this field is provided, it must be either fiat or currency, not both.
ISO 4217 3-digit fiat currency code, supported fiat currencies: CNY/USD/EUR/HKD/INR/IDR/PHP/THB
currencyNostringCryptocurrency, for example: BCNY (recommended, 1:1 with CNY), USDT, BTC, etc. View currency list. If this parameter is provided, the invoice can only be paid with this cryptocurrency. If this field is provided, it must be either fiat or currency, not both
forcedChainNostringForce selection of a specified public chain, for example: TRC20, ERC20 View blockchain list. If this parameter is provided, users can only pay on the specified public chain and cannot use the BasicEx wallet for payment
amountYesdecimalThe amount field, combined with the precision precision field, in integer format. For example, if precision is 2 (amount ÷ 10²), the user pays 2.00, you need to pass 200
precisionYesintAmount precision, recommended precision of 2-6 digits.
amountTypeYesstringAmount type field, indicating whether the amount passed in is a fiat currency or a cryptocurrency amount.
coin_amount cryptocurrency amount, money_price fiat currency amount
descriptionYesstringProduct description field, which will be displayed on the checkout page for product details
metadataNojsonStructured metadata passed in for the merchant's own record, this field will be returned as-is in subsequent responses
payerEmailNostringCustomer email on the merchant's side. If provided, an email will be sent to this address after the invoice payment is successful
notificationUrlYesstringThe URL for webhook notifications to be sent to the merchant's specified address, must be HTTPS
redirectUrlNostringAfter the user successfully pays on the checkout page, they will be redirected to this address. The address must start with https or http
buyerIpNostringCustomer's IP address on the merchant's side
sendPaidNotificationNoboolWhether to send notification data for the paid state.
Default is false. If set to true, BasicEx will send a paid status notification after receiving the user's transfer payment and confirming one block on the blockchain.
Based on the characteristics of the blockchain, this does not mean that the order is completely valid. BasicEx will send a complete status notification after confirming that the transaction is successful and irreversible. This process may take some time
physicalNoboolWhether it is a physical product, default is false, set to true if it's a physical product

Response Parameters

BasicEx payment response parameters, specific values depend on business requirements.

After a successful order request, the response code is 0000.

InvoiceObject

Payment invoice response parameters

FieldTypeDescription
invoiceIdstringPayment invoice order ID
merOrderIdstringInternal order number on the merchant side
fiatstringISO 4217 3-digit fiat currency code
currencystringIf the payment invoice order restricts the payment currency or chooses the payment currency, this field is returned
currencyInfoCoinInfoIf the payment invoice order restricts the payment network or chooses the payment network, this field is returned
View details
forcedChainstringIf the payment invoice order restricts the payment network or chooses the payment network, this field is returned
View details
fiatAmountstringThe fiat amount of the payment invoice
fiatInfoFiatCurrencyInfoFiat currency details
View details
descriptionstringDescription of the payment invoice order
metadatamapStructured metadata passed in for the merchant's own record, this field will be returned as-is in subsequent responses
payerEmailstringCustomer email on the merchant's side
merchantCodestringMerchant code
merchantNamestringMerchant name
currenciesListList of supported cryptocurrency information
fiatCurrenciesListList of supported fiat currency information
paymentInfoInvoicePaymentInfoPayment information
View details
exchangeRateInvoiceExchangeRateExchange rate information
typeintPayment invoice order type, this order type is read in XOR form.
1. FIAT_CURRENCY_EXCHANGE: Indicates that the payment invoice is created in the form of fiat currency exchange cryptocurrency
2. FORCE_SELECTED_CHAIN: Indicates that the payment invoice is created in the form of forcibly selecting a public chain, and the currency and payment public chain cannot be changed later. Only payments on this chain are supported
3. FORCE_SELECTED_COIN: Indicates that the payment invoice is created in the form of forcibly selecting a cryptocurrency currency, and the currency cannot be changed later, only this currency is supported for payment
statusstringThe current status of the payment invoice (created: indicates that the payment invoice is created but not paid, completed: indicates that the payment invoice has been paid and completed, expired: indicates that the payment invoice has expired)
invoiceTimelongCreation time of the payment invoice (13 digits)
expirationTimelongExpiration time of the payment invoice (13 digits)
cashierUrlstringThe BasicEx cashier order URL corresponding to the payment invoice, which can be used to pay this unpaid order again to avoid multiple submissions of unpaid orders by users

CoinInfo

Coin information

FieldTypeDescription
currencystringCurrency name
fullNamestringFull name of the currency
coinIconstringCurrency icon
precisionstringCurrency precision
networkListstringList of supported blockchain networks for the currency

CoinChainInfo

Blockchain information

FieldTypeDescription
networkstringBlockchain network name
fullNamestringBlockchain network full name
contractAddressstringContract address

FiatCurrencyInfo

Fiat currency information

FieldTypeDescription
fullNamestringFull name of the fiat currency
namestringFiat currency name
symbolstringCurrency symbol
iconstringCurrency icon

InvoicePaymentInfo

Invoice order information

FieldTypeDescription
allowPaymentstringWhether payment is allowed. If true, it means that this payment order allows payment. If false, it means that the preconditions are not met, such as no payment amount, no selected currency, no selected public chain, or the receiving address has expired, etc
payeeAddressstringPayee address, the actual address where the user completes the transfer payment
networkCoinChainInfoNetwork information
View details
totalAmountstringThe total amount the user needs to pay
paidAmountstringThe amount the user has paid
payeeAddressExpireTimeintPayee address expiration time, in milliseconds, the payment or re-acquiring the payee address must be completed before the expiration time