Documentation

INVOICES


This section includes methods for issuing invoices, viewing the history and current status of issued invoices.
All information about invoices is also available in the personal account.


CREATE INVOICE

The method creates an invoice with the specified parameters and returns the details of the newly created invoice.
Request
HTTP Method: POST
Content Type: application/json
URL: https://api.apiforcrypto.com/api/v1/wallets/{wallet id}/invoices

Parameter Type Description Required
wallet id string Wallet ID yes
blockchain string Blockchain yes
symbol string Cryptocurrency or token symbol yes
value int Invoice amount in cryptocurrency. If this parameter is specified, the "fiatCurrency array" object is not passed in the request. no
fiatCurrency array Fiat currency data array. no
- currency string Select fiat currency if the invoice is issued in fiat currency. The invoice will be issued in the selected cryptocurrency, based on the current exchange rate of this fiat currency to the cryptocurrency. no
- value int Invoice amount in fiat currency. no
- percent int Invoice markup percentage. If the invoice is issued in fiat currency and the user wants to receive funds in cryptocurrency with an additional percentage, it can be specified here. no
expiry int Waiting time for invoice payment in minutes. After this time elapses, the invoice will be considered unpaid, and the address can be used to issue another invoice.
The allowed time is from 15 to 40 minutes inclusive.
yes
confirmations int Number of network confirmations after which the invoice will be considered paid. yes
secret_key string User's secret key. Used to enhance the confidentiality of the invoice status. The user can use any personal secret key for each invoice, for one invoice, or not use it at all. The secret key is transmitted only in the notification to the "url_callback" resource. no
data array User information. no
- order_id string User Invoice ID no
- title string Invoice name no
- description string invoice description. no
- url_callback string User's address for notification of invoice status changes. no
- url_success string User address to which the payer will be redirected after paying the invoice.
Always add "http://" or "https://" before the resource where the redirection is required after the invoice activity is completed.
no
- url_failed string User address to which the payer will be redirected if the invoice payment fails.
Always add "http://" or "https://" before the resource where the redirection is required after the invoice activity is completed.
no
- user_data string Any user information. no
Request example (for an invoice in fiat currency.)
Request example (for an invoice in cryptocurrency.)
Success Response Reference
HTTP Status Code: 200

Parameter Type Description
id string Unique number of the issued invoice.
blockchain string Blockchain
symbol string Cryptocurrency or token symbol
address string Address for paying the invoice.
contract_address string Contract address, if the invoice was issued in a token.
active boolean Whether the invoice is active or not
value int The final amount for payment in the blockchain currency or token currency, if there is a contract address.
created string Invoice creation date
expiry string Time until which the invoice is valid. If no payment is made to the specified address within the specified time, the invoice becomes invalid.
status string Invoice status. Can take the values "PAID", "NOT_PAID", "IN_MEMPOOL", "PARTIALLY_PAID", "IN_BLOCK".
confirmations int Number of transaction confirmations on the network.
fiat_currency array Invoice data in fiat currency
txs string Hash of each transaction for this invoice
data array User information.
- url_pay string You can redirect your client to this link for invoice payment.
Response example
Error response
HTTP Status Code:
403 - Currency is not active / Create invoice forbidden
404 - Wallet not found
500 - Internal Server Error
Content Type: - application/json

Example of a request to the client's server via the "url_callback" link:

Create Invoice Parameter
Wallet ID *
Blockchain *
Symbol *
Value (in crypto)
Currency (if the invoice is in fiat)
Value (in fiat)
Percent (if you need)
Expiry (minute)
Confirmation
Secret Key
Your Order ID
Title
Description
URL Callback
URL success
URL failed
User data


GET INVOICE

The method returns information about an invoice based on its UUID number.
Request
HTTP Method: GET
Content Type: -
URL: https://api.apiforcrypto.com/api/v1/wallets/invoices/{UUID}

Parameter Type Description Required
UUID string Invoice UUID yes
Request example
curl -X GET "https://api.apiforcrypto.com/api/v1/wallets/invoices/e7d2f92a-3408-4ef7-951c-3a91665338cd"
Success Response Reference
HTTP Status Code: 200

Parameter Type Description
id string Unique number of the issued invoice.
blockchain string Blockchain
symbol string Cryptocurrency or token symbol
address string Address for paying the invoice.
contract_address string Contract address, if the invoice was issued in a token.
active boolean Whether the invoice is active or not
value int The final amount for payment in the blockchain currency or token currency, if there is a contract address.
created string Invoice creation date
expiry string Time until which the invoice is valid. If no payment is made to the specified address within the specified time, the invoice becomes invalid.
status string Invoice status. Can take the values "PAID", "NOT_PAID", "IN_MEMPOOL", "PARTIALLY_PAID", "IN_BLOCK".
confirmations int Number of transaction confirmations on the network.
fiat_currency array Invoice data in fiat currency
txs string Hash of each transaction for this invoice
data array User information.
Response example
Error response
HTTP Status Code:
404 - Invoice not found
500 - Internal Server Error
Content Type: - application/json


GET INVOICE Parameter
UUID