Create invoice
Invoice can be created in two methods manual or using API this instruction is show how to create API using APIs
curl -X POST https://api.nebulox.io/api/invoice/create \
-H "Content-Type: application/json" \
-d '{
"apiKey": "YOUR_API_KEY",
"price": "100",
"orderId": "YOUR_ORDER_ID",
"baseCurrency": "usd",
"coinSymbol": "BTC",
"networkName": "Bitcoin",
"amount": "0.0025"
}'
const axios = require('axios');
axios.post('https://api.nebulox.io/api/invoice/create', {
apiKey: 'YOUR_API_KEY',
price: '100',
orderId: 'YOUR_ORDER_ID',
baseCurrency: 'usd',
coinSymbol: 'BTC',
networkName: 'Bitcoin'
amount:'0.0025'
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.error(error);
});
<?php
$apiUrl = 'https://api.nebulox.io/api/invoice/create';
$data = array(
'apiKey' => 'YOUR_API_KEY',
'price' => '100',
'orderId' => 'YOUR_ORDER_ID',
'baseCurrency' => 'usd',
'coinSymbol' => 'BTC',
'networkName' => 'Bitcoin',
'amount' => '0.0025'
);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$response = curl_exec($ch);
if(curl_errno($ch)){
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>
import requests
import json
url = 'https://api.nebulox.io/api/invoice/create'
data = {
'apiKey': 'YOUR_API_KEY',
'price': '100',
'orderId': 'YOUR_ORDER_ID',
'baseCurrency': 'usd',
'coinSymbol': 'BTC',
'networkName': 'Bitcoin',
'amount': '0.0025'
}
headers = {'Content-Type': 'application/json'}
try:
response = requests.post(url, data=json.dumps(data), headers=headers)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
Make your first request
To make your first request, send an authenticated request to the create invoice endpoint. This will create an invoice, which is nice.
Creating invoice
Create Invoice.
POST
https://api.nebulox.io/api/invoice/create
This method creates an invoice with the specified parameters
Request Body
Merchant's order unique identifier. It will be used to track order.
Your order payment network
{
"message": "Operation was successful.",
"result": {
"price": 10,
"orderId": "Nebulox-1234",
"status": "PENDING",
"gatewayId": "41c6fe17-b72f-4923-9da2-dc7a91173e73",
"userId": "d6646cf8-0b65-4d7d-ab2b-02e8dcd1ede3",
"addressId": null,
"amount": 0.0025,
"coinId": null,
"networkId": null,
"info": null,
"id": "5c5a7933-51ad-4542-b0b6-9157552e8230",
"created_at": "2023-02-13T12:18:00.672Z",
"updated_at": "2023-02-13T12:18:00.672Z",
"url": "https://nebulox.io/invoice/5c5a7933-51ad-4542-b0b6-9157552e8230"
},
"meta": {}
}
{
"message": "This gateway is not active",
"result": [],
"meta": {}
}
baseCurrency
must be in [EUR, USD].
coinSymbol
must be in [BTC,LTC,USDT,TRX,DOGE].
networkName
must be in [Bitcoin,Litecoin,Tron,Dogecoin].
The price
field should remain blank if you enter a value for the amount
.
The amount
field should remain blank if you enter a value for the Price
.
If you enter a value for the amount
field you must fill the coinSymbol
too.
Last updated