Initiate a Buy Transaction
curl --request POST \
--url https://api.ngnc.online/transactions/v1/onramp \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'ngnc-sec-key: NGNC_SECRET_KEY' \
--data '
{
"business_id": "string",
"link_tag": "string",
"type": "string",
"amount": 0,
"vendor_number": "string",
"vendor_name": "string",
"vendor_bank": "string",
"account_number": "string",
"bank_name": "string",
"network": "string",
"wallet_address": "string"
}'
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'ngnc-sec-key': 'NGNC_SECRET_KEY',
'content-type': 'application/json'
},
body: JSON.stringify({
"business_id": "string",
"link_tag": "string",
"type": "string",
"amount": 0,
"vendor_number": "string",
"vendor_name": "string",
"vendor_bank": "string",
"account_number": "string",
"bank_name": "string",
"network": "string",
"wallet_address": "string"
});
};
fetch('https://api.ngnc.online/transactions/v1/onramp', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import requests
url = "https://api.ngnc.online/transactions/v1/onramp"
payload = {
"business_id": "string",
"link_tag": "string",
"type": "string",
"amount": 0,
"vendor_number": "string",
"vendor_name": "string",
"vendor_bank": "string",
"account_number": "string",
"bank_name": "string",
"network": "string",
"wallet_address": "string"
}
headers = {
"accept": "application/json",
"ngnc-sec-key": "NGNC_SECRET_KEY",
"content-type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.ngnc.online/transactions/v1/onramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["ngnc-sec-key"] = 'NGNC_SECRET_KEY'
request["content-type"] = 'application/json'
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\"}"
response = http.request(request)
puts response.read_body
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api.ngnc.online/transactions/v1/onramp', [
'body' => '{
"business_id": "string",
"link_tag": "string",
"type": "string",
"amount": 0,
"vendor_number": "string",
"vendor_name": "string",
"vendor_bank": "string",
"account_number": "string",
"bank_name": "string",
"network": "string",
"wallet_address": "string"
}',
'headers' => [
'accept' => 'application/json',
'content-type' => 'application/json',
'ngnc-sec-key' => 'NGNC_SECRET_KEY',
],
]);
echo $response->getBody();
import Foundation
let headers = [
"accept": "application/json",
"ngnc-sec-key": "NGNC_SECRET_KEY",
"content-type": "application/json"
]
let parameters = [
"business_id": "string",
"link_tag": "string",
"type": "string",
"amount": 0,
"vendor_number": "string",
"vendor_name": "string",
"vendor_bank": "string",
"account_number": "string",
"bank_name": "string",
"network": "string",
"wallet_address": "string"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.ngnc.online/transactions/v1/onramp")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
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\"}")
require 'net/http'
require 'openssl'
url = URI("https://api.ngnc.online/transactions/v1/onramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["ngnc-sec-key"] = 'NGNC_SECRET_KEY'
request["content-type"] = 'application/json'
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\"}"
response = http.request(request)
puts response.read_bod\":\"string\"}")
val request = Request.Builder()
.url("https://api.ngnc.online/transactions/v1/onramp")
.post(body)
.addHeader("accept", "application/json")
.addHeader("ngnc-sec-key", "NGNC_SECRET_KEY")
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
// 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));
{
"status": "success",
"message": "Transaction Request successful",
"transaction": {
"transaction_id": "645c329afc3ac414bf70f9a1",
"business": {
"business_id": "0123456789"
},
"type": "Buy",
"reference": "0984938271",
"amount": 25639.55,
"link_account_name": "Okemdinachi Nwaejie",
"link_account_number": "8180789670",
"link_bank_name": "Wema Bank",
"account_number": "3338900202",
"bank_name": "Providus Bank",
"link_tag": "Link_eng",
"network": "Avalanche",
"wallet_address": "x.fie9383jEU8394jdnc",
"date_created": "May 11, 2023"
}
}