curl --request POST \
--url https://test.api.orionramp.com/api/transaction/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "KESy_TESTNET",
"amount": 250000.5,
"email": "jsmith@example.com",
"currency": "KES",
"metadata": {
"orderID": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"callback_url": "<string>",
"channels": [],
"crypto_account": "<string>"
}
'import requests
url = "https://test.api.orionramp.com/api/transaction/initialize"
payload = {
"token": "KESy_TESTNET",
"amount": 250000.5,
"email": "jsmith@example.com",
"currency": "KES",
"metadata": { "orderID": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"callback_url": "<string>",
"channels": [],
"crypto_account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
token: 'KESy_TESTNET',
amount: 250000.5,
email: 'jsmith@example.com',
currency: 'KES',
metadata: {orderID: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
callback_url: '<string>',
channels: [],
crypto_account: '<string>'
})
};
fetch('https://test.api.orionramp.com/api/transaction/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.api.orionramp.com/api/transaction/initialize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'token' => 'KESy_TESTNET',
'amount' => 250000.5,
'email' => 'jsmith@example.com',
'currency' => 'KES',
'metadata' => [
'orderID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'callback_url' => '<string>',
'channels' => [
],
'crypto_account' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.api.orionramp.com/api/transaction/initialize"
payload := strings.NewReader("{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test.api.orionramp.com/api/transaction/initialize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.api.orionramp.com/api/transaction/initialize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"reference": "<string>",
"authorization_url": "<string>",
"access_code": "<string>"
}Initialize payment
This is what gives you the payment URL that you’re user will use to pay for a service, that payment will then be onramped and sent to your account. You need to add Bearer auth token that has your private key from the platform
curl --request POST \
--url https://test.api.orionramp.com/api/transaction/initialize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "KESy_TESTNET",
"amount": 250000.5,
"email": "jsmith@example.com",
"currency": "KES",
"metadata": {
"orderID": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"callback_url": "<string>",
"channels": [],
"crypto_account": "<string>"
}
'import requests
url = "https://test.api.orionramp.com/api/transaction/initialize"
payload = {
"token": "KESy_TESTNET",
"amount": 250000.5,
"email": "jsmith@example.com",
"currency": "KES",
"metadata": { "orderID": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"callback_url": "<string>",
"channels": [],
"crypto_account": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
token: 'KESy_TESTNET',
amount: 250000.5,
email: 'jsmith@example.com',
currency: 'KES',
metadata: {orderID: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
callback_url: '<string>',
channels: [],
crypto_account: '<string>'
})
};
fetch('https://test.api.orionramp.com/api/transaction/initialize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test.api.orionramp.com/api/transaction/initialize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'token' => 'KESy_TESTNET',
'amount' => 250000.5,
'email' => 'jsmith@example.com',
'currency' => 'KES',
'metadata' => [
'orderID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'callback_url' => '<string>',
'channels' => [
],
'crypto_account' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test.api.orionramp.com/api/transaction/initialize"
payload := strings.NewReader("{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test.api.orionramp.com/api/transaction/initialize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.api.orionramp.com/api/transaction/initialize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"token\": \"KESy_TESTNET\",\n \"amount\": 250000.5,\n \"email\": \"jsmith@example.com\",\n \"currency\": \"KES\",\n \"metadata\": {\n \"orderID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"callback_url\": \"<string>\",\n \"channels\": [],\n \"crypto_account\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"reference": "<string>",
"authorization_url": "<string>",
"access_code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The token you want to receive
KESy_TESTNET The amount of money you want user to pay
1 <= x <= 500000The user's email, where they'll be sent payment notification
The currency that user is paying in
KES Show child attributes
Show child attributes
Optional callback URL that you want user to be redirected to after completing payment
The payment channel you want user to use
card, bank, ussd, qr, mobile_money, bank_transfer, eft, apple_pay, payattitude If you want the tokens to be sent to a different account from the one entered when creating business you can pass it here. It is a Hedera account ID e.g. 0.0.7441630