invoice_id (number): The unique identifier of the created invoice.
message (string): Result Description.
Step 2: Making a payment on an invoice
The method is used to pay a previously created invoice.
Request URL:POST /invoice/pay
Let's update the documentation for the /invoice/pay method to reflect the new response format.
Method: Making payment on invoice
The method is used to pay a previously created invoice. The response returns information about the payment, including the address for funds transfer, amount, commission and additional data.
Request URL:
POST /invoice/pay
Example request (cURL):
Request body:
Field
Type
Required
Description
Example of a value
idInvoice
number
Yes
Unique invoice identifier
12345
An example of a successful response:
Response Fields Description:
Field
Type
Description
address
string
The address of the wallet to which you want to transfer funds.
amount
string
Transfer amount in the specified cryptocurrency.
rate
float64
The exchange rate of a currency relative to the base currency of the invoice.
name
string
The name of the cryptocurrency network (e.g., Tron Shasta Testnet).
code
string
The code of the cryptocurrency in which the transfer is made (e.g. TRX).
transferCommissionWeis*
float64
(If available) Amount of transfer fee in units of cryptocurrency.
*The transferCommissionWeis field may be enabled depending on API settings or request context.
Example of how to use a response:
After receiving the answer, you can:
Send the amount to the address via the selected cryptocurrency wallet.
Ensure that the correct currency code (code) and network (name) are used.
Error Handling:
Response code
Description
Possible causes
400
Invalid request
Absence of a mandatory parameter.
404
Invoice not found
Non-Existent idInvoice is specified .
500
Internal server error
Server-side problems.
3. A complete example of executing two queries
Create an invoice:
Result:
Make the payment:
Result:
4. Errors and their handling
The following errors may occur when working with the API: