NGNC Bridge
Search
K
Comment on page

Buy NGNC

This endpoint can be used to intiate an NGNC On-ramp transaction.

Initiate a Buy Transaction

Use this endpoint to perform a buy transaction. POST api.ngnc.online/transactions/v1/onramp
Shell
JavaScript
Python
Ruby
PHP
Swift
Kotlin
1
curl --request POST \
2
--url https://api.ngnc.online/transactions/v1/onramp \
3
--header 'accept: application/json' \
4
--header 'content-type: application/json' \
5
--header 'ngnc-sec-key: NGNC_SECRET_KEY' \
6
--data '
7
{
8
"business_id": "string",
9
"link_tag": "string",
10
"type": "string",
11
"amount": 0,
12
"vendor_number": "string",
13
"vendor_name": "string",
14
"vendor_bank": "string",
15
"account_number": "string",
16
"bank_name": "string",
17
"network": "string",
18
"wallet_address": "string"
19
}'
1
const options = {
2
method: 'POST',
3
headers: {
4
accept: 'application/json',
5
'ngnc-sec-key': 'NGNC_SECRET_KEY',
6
'content-type': 'application/json'
7
},
8
body: JSON.stringify({
9
"business_id": "string",
10
"link_tag": "string",
11
"type": "string",
12
"amount": 0,
13
"vendor_number": "string",
14
"vendor_name": "string",
15
"vendor_bank": "string",
16
"account_number": "string",
17
"bank_name": "string",
18
"network": "string",
19
"wallet_address": "string"
20
});
21
};
22
23
fetch('https://api.ngnc.online/transactions/v1/onramp', options)
24
.then(response => response.json())
25
.then(response => console.log(response))
26
.catch(err => console.error(err));
1
2
import requests
3
4
url = "https://api.ngnc.online/transactions/v1/onramp"
5
6
payload = {
7
"business_id": "string",
8
"link_tag": "string",
9
"type": "string",
10
"amount": 0,
11
"vendor_number": "string",
12
"vendor_name": "string",
13
"vendor_bank": "string",
14
"account_number": "string",
15
"bank_name": "string",
16
"network": "string",
17
"wallet_address": "string"
18
}
19
headers = {
20
"accept": "application/json",
21
"ngnc-sec-key": "NGNC_SECRET_KEY",
22
"content-type": "application/json"
23
}
24
25
response = requests.post(url, json=payload, headers=headers)
26
27
print(response.text)
1
require 'uri'
2
require 'net/http'
3
require 'openssl'
4
5
url = URI("https://api.ngnc.online/transactions/v1/onramp")
6
7
http = Net::HTTP.new(url.host, url.port)
8
http.use_ssl = true
9
10
request = Net::HTTP::Post.new(url)
11
request["accept"] = 'application/json'
12
request["ngnc-sec-key"] = 'NGNC_SECRET_KEY'
13
request["content-type"] = 'application/json'
14
request.body = "{\"business_id\":\"string\",\"link_tag\":\"string\",\"amount\":0,\"type\":\"string\",\"account_number\":\"string\",\"bank_name\":\"string\",\"network\":\"string\",\"wallet_address\":\"string\",\"vendor_number\":\"string\",\"vendor_name\":\"string\",\"vendor_bank\":\"string\"}"
15
16
response = http.request(request)
17
puts response.read_body
1
<?php
2
require_once('vendor/autoload.php');
3
4
$client = new \GuzzleHttp\Client();
5
6
$response = $client->request('POST', 'https://api.ngnc.online/transactions/v1/onramp', [
7
'body' => '{
8
"business_id": "string",
9
"link_tag": "string",
10
"type": "string",
11
"amount": 0,
12
"vendor_number": "string",
13
"vendor_name": "string",
14
"vendor_bank": "string",
15
"account_number": "string",
16
"bank_name": "string",
17
"network": "string",
18
"wallet_address": "string"
19
}',
20
'headers' => [
21
'accept' => 'application/json',
22
'content-type' => 'application/json',
23
'ngnc-sec-key' => 'NGNC_SECRET_KEY',
24
],
25
]);
26
27
echo $response->getBody();
1
import Foundation
2
3
let headers = [
4
"accept": "application/json",
5
"ngnc-sec-key": "NGNC_SECRET_KEY",
6
"content-type": "application/json"
7
]
8
let parameters = [
9
"business_id": "string",
10
"link_tag": "string",
11
"type": "string",
12
"amount": 0,
13
"vendor_number": "string",
14
"vendor_name": "string",
15
"vendor_bank": "string",
16
"account_number": "string",
17
"bank_name": "string",
18
"network": "string",
19
"wallet_address": "string"
20
] as [String : Any]
21
22
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
23
24
let request = NSMutableURLRequest(url: NSURL(string: "https://api.ngnc.online/transactions/v1/onramp")! as URL,
25
cachePolicy: .useProtocolCachePolicy,
26
timeoutInterval: 10.0)
27
request.httpMethod = "POST"
28
request.allHTTPHeaderFields = headers
29
request.httpBody = postData as Data
30
31
let session = URLSession.shared
32
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
33
if (error != nil) {
34
print(error as Any)
35
} else {
36
let httpResponse = response as? HTTPURLResponse
37
print(httpResponse)
38
}
39
})
40
41
dataTask.resume()
1
val client = OkHttpClient()
2
3
val mediaType = MediaType.parse("application/json")
4
val body = RequestBody.create(mediaType, "{\"business_id\":\"string\",\"link_tag\":\"string\",\"amount\":0,\"type\":\"string\",\"account_number\":\"string\",\"bank_name\":\"string\",\"network\":\"string\",\"wallet_address\":\"string\",\"vendor_number\":\"string\",\"vendor_name\":\"string\",\"vendor_bank\":\"string\"}")
5
require 'net/http'
6
require 'openssl'
7
8
url = URI("https://api.ngnc.online/transactions/v1/onramp")
9
10
http = Net::HTTP.new(url.host, url.port)
11
http.use_ssl = true
12
13
request = Net::HTTP::Post.new(url)
14
request["accept"] = 'application/json'
15
request["ngnc-sec-key"] = 'NGNC_SECRET_KEY'
16
request["content-type"] = 'application/json'
17
request.body = "{\"business_id\":\"string\",\"link_tag\":\"string\",\"amount\":0,\"type\":\"string\",\"account_number\":\"string\",\"bank_name\":\"string\",\"network\":\"string\",\"wallet_address\":\"string\",\"vendor_number\":\"string\",\"vendor_name\":\"string\",\"vendor_bank\":\"string\"}"
18
19
response = http.request(request)
20
puts response.read_bod\":\"string\"}")
21
val request = Request.Builder()
22
.url("https://api.ngnc.online/transactions/v1/onramp")
23
.post(body)
24
.addHeader("accept", "application/json")
25
.addHeader("ngnc-sec-key", "NGNC_SECRET_KEY")
26
.addHeader("content-type", "application/json")
27
.build()
28
29
val response = client.newCall(request).execute()
Parameter
Type
Description
Required
business_id
String
Buiness ID. can be found on dashbord at app.ngnc.online.
True
link_tag
String
Your Business link_tag.
True
type
String
buy_ramp
True
amount
String
Amount user wishes to onramp and meant to send to vendor. (Min ₦15000)
True
vendor_name Vendors_bank Vendor_number
String
Use the List Vendors ENDPOINT to fetch the list of supported payment vendors
True
network
String
Our supported networks are (Stellar, Polygon, Solana, Avalanche)
False
wallet_address
String
False
bank_name
String
Proof of payment Bank used to send money to the vendor account
True
account_number
String
Proof of payment Account number of bank used to send money to the vendor account
True
// Sample Buy Request in Javascript
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'ngnc-sec-key': 'NGNC_SECRET_KEY',
'content-type': 'application/json'
},
body: JSON.stringify({
"business_id": "8a90we32394kds3204",
"link_tag": "Link_Eng",
"type": "buy_ramp",
"amount": 1000,
"reference": "478939302",
"vendor_number": "028374332",
"vendor_name": "John Doe",
"vendor_bank": "Wema bank",
"account_number": "303828284",
"bank_name": "Wema bank",
"network": "solana",
"wallet_address": "x.037473js874sdhdy3"
});
};
fetch('https://api.ngnc.online/transactions/v1/onramp', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
post
https://api.ngnc.online/transactions/v1/onramp
On Ramp NGNC