Creating an invoice and making a payment
Documentation: Working with API to create an invoice and make a payment
1. General information
The API provides the ability to manage invoices: create new invoices and make payments on them.
Base URL:
https://api.client.nbcgate.tech
2. Steps of work
Step 1: Creating an invoice
The method is used to create a new invoice specifying the amount, currency, product and other data.
Request URL:
POST /invoice/create
Example request (cURL):
Description of the request body parameters:
amount
number
Invoice amount
100
coin_id
number
Currency identifier (e.g. 1 - USD)
1
id
number
Unique identifier pay_link
12345
product_id
number
Product Identifier
67890
Response answer (JSON):
Response Description:
success
(boolean): Transaction Status.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:
idInvoice
number
Yes
Unique invoice identifier
12345
An example of a successful response:
Response Fields 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
theaddress
via the selected cryptocurrency wallet.Ensure that the correct currency code (
code
) and network (name
) are used.
Error Handling:
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:
400
Invalid request
Lack of mandatory parameters.
404
Invoice not found
Non-Existent idInvoice
is specified .
500
Internal server error
Server-side problems.
Last updated