curl --request POST \
--url https://prod-api.pcxpay.com/v1/payments-init/ramp \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"fiat_currency": "NGN",
"fiat_amount": 10000,
"client_rate": 0.00000645,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"country": "NG",
"user_id": "<string>",
"org_id": "<string>",
"customer_type": "retail",
"business_id": "<string>",
"business_name": "<string>",
"wallet_address": "0xABC123...your-wallet-address",
"mobile_money_details": {
"provider": "MTN",
"phone_number": "+2348122603628"
},
"bank_details": {
"account_number": "<string>",
"bank_code": "<string>",
"bank_name": "<string>"
},
"beneficiary_id": "<string>",
"beneficiary_name": "<string>",
"destination": {
"accountNumber": "<string>",
"bankCode": "<string>",
"bankName": "<string>"
},
"metadata": {}
}
'import requests
url = "https://prod-api.pcxpay.com/v1/payments-init/ramp"
payload = {
"fiat_currency": "NGN",
"fiat_amount": 10000,
"client_rate": 0.00000645,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"country": "NG",
"user_id": "<string>",
"org_id": "<string>",
"customer_type": "retail",
"business_id": "<string>",
"business_name": "<string>",
"wallet_address": "0xABC123...your-wallet-address",
"mobile_money_details": {
"provider": "MTN",
"phone_number": "+2348122603628"
},
"bank_details": {
"account_number": "<string>",
"bank_code": "<string>",
"bank_name": "<string>"
},
"beneficiary_id": "<string>",
"beneficiary_name": "<string>",
"destination": {
"accountNumber": "<string>",
"bankCode": "<string>",
"bankName": "<string>"
},
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fiat_currency: 'NGN',
fiat_amount: 10000,
client_rate: 0.00000645,
crypto_currency: 'USDC',
crypto_network: 'ethereum',
country: 'NG',
user_id: '<string>',
org_id: '<string>',
customer_type: 'retail',
business_id: '<string>',
business_name: '<string>',
wallet_address: '0xABC123...your-wallet-address',
mobile_money_details: {provider: 'MTN', phone_number: '+2348122603628'},
bank_details: {account_number: '<string>', bank_code: '<string>', bank_name: '<string>'},
beneficiary_id: '<string>',
beneficiary_name: '<string>',
destination: {accountNumber: '<string>', bankCode: '<string>', bankName: '<string>'},
metadata: {}
})
};
fetch('https://prod-api.pcxpay.com/v1/payments-init/ramp', 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://prod-api.pcxpay.com/v1/payments-init/ramp",
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([
'fiat_currency' => 'NGN',
'fiat_amount' => 10000,
'client_rate' => 0.00000645,
'crypto_currency' => 'USDC',
'crypto_network' => 'ethereum',
'country' => 'NG',
'user_id' => '<string>',
'org_id' => '<string>',
'customer_type' => 'retail',
'business_id' => '<string>',
'business_name' => '<string>',
'wallet_address' => '0xABC123...your-wallet-address',
'mobile_money_details' => [
'provider' => 'MTN',
'phone_number' => '+2348122603628'
],
'bank_details' => [
'account_number' => '<string>',
'bank_code' => '<string>',
'bank_name' => '<string>'
],
'beneficiary_id' => '<string>',
'beneficiary_name' => '<string>',
'destination' => [
'accountNumber' => '<string>',
'bankCode' => '<string>',
'bankName' => '<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://prod-api.pcxpay.com/v1/payments-init/ramp"
payload := strings.NewReader("{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-api-key>")
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://prod-api.pcxpay.com/v1/payments-init/ramp")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payments-init/ramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"response": {
"success": true,
"payment_id": "ea5965e4-1432-40ef-bccf-cb51455a935a",
"transaction_id": "2a679c96-69bf-424c-89cb-c2f4a90a2738",
"direction": "on_ramp",
"status": "pending",
"fiat_currency": "NGN",
"fiat_amount": 10000,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"crypto_amount": 6.45,
"provider": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"next_action": "make_transfer",
"payment_instructions": {
"type": "bank_transfer",
"account_name": "PCX Collections",
"account_number": "0123456789",
"bank_name": "Access Bank",
"amount": 10000,
"currency": "NGN",
"reference": "PCX-ea5965e4"
}
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}{
"error": "Rate has drifted. Please re-fetch the exchange rate.",
"message": "Rate has drifted. Please re-fetch the exchange rate.",
"code": "RATE_MISMATCH"
}Initiate a crypto ramp
Initiate an on-ramp (fiat → crypto) or off-ramp (crypto → fiat) conversion. PCX acts as the orchestrator — your users send or receive fiat, and PCX handles the crypto settlement automatically.
On-ramp: the customer pays in fiat using their preferred payment method. Once the fiat collection is confirmed, the crypto is settled directly to the wallet_address you provide. No further action is needed after a successful initiation.
Off-ramp: the customer sends crypto and receives fiat to a registered beneficiary’s bank or mobile money account.
You must fetch a fresh rate from GET /organizations/admin/exchange-rate immediately before presenting it to the user and before submitting this request. The rate must be fetched in the same direction the funds flow — fromCurrency=fiat&toCurrency=crypto for on_ramp, and fromCurrency=crypto&toCurrency=fiat for off_ramp. Use the crypto asset code itself (e.g. USDC), not its fiat equivalent. The client_rate you send is validated against the current live rate for that direction — if it has drifted more than 0.5% (or was fetched in the wrong direction), the request is rejected with RATE_MISMATCH and you must re-fetch.
curl --request POST \
--url https://prod-api.pcxpay.com/v1/payments-init/ramp \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"fiat_currency": "NGN",
"fiat_amount": 10000,
"client_rate": 0.00000645,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"country": "NG",
"user_id": "<string>",
"org_id": "<string>",
"customer_type": "retail",
"business_id": "<string>",
"business_name": "<string>",
"wallet_address": "0xABC123...your-wallet-address",
"mobile_money_details": {
"provider": "MTN",
"phone_number": "+2348122603628"
},
"bank_details": {
"account_number": "<string>",
"bank_code": "<string>",
"bank_name": "<string>"
},
"beneficiary_id": "<string>",
"beneficiary_name": "<string>",
"destination": {
"accountNumber": "<string>",
"bankCode": "<string>",
"bankName": "<string>"
},
"metadata": {}
}
'import requests
url = "https://prod-api.pcxpay.com/v1/payments-init/ramp"
payload = {
"fiat_currency": "NGN",
"fiat_amount": 10000,
"client_rate": 0.00000645,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"country": "NG",
"user_id": "<string>",
"org_id": "<string>",
"customer_type": "retail",
"business_id": "<string>",
"business_name": "<string>",
"wallet_address": "0xABC123...your-wallet-address",
"mobile_money_details": {
"provider": "MTN",
"phone_number": "+2348122603628"
},
"bank_details": {
"account_number": "<string>",
"bank_code": "<string>",
"bank_name": "<string>"
},
"beneficiary_id": "<string>",
"beneficiary_name": "<string>",
"destination": {
"accountNumber": "<string>",
"bankCode": "<string>",
"bankName": "<string>"
},
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Api-Key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fiat_currency: 'NGN',
fiat_amount: 10000,
client_rate: 0.00000645,
crypto_currency: 'USDC',
crypto_network: 'ethereum',
country: 'NG',
user_id: '<string>',
org_id: '<string>',
customer_type: 'retail',
business_id: '<string>',
business_name: '<string>',
wallet_address: '0xABC123...your-wallet-address',
mobile_money_details: {provider: 'MTN', phone_number: '+2348122603628'},
bank_details: {account_number: '<string>', bank_code: '<string>', bank_name: '<string>'},
beneficiary_id: '<string>',
beneficiary_name: '<string>',
destination: {accountNumber: '<string>', bankCode: '<string>', bankName: '<string>'},
metadata: {}
})
};
fetch('https://prod-api.pcxpay.com/v1/payments-init/ramp', 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://prod-api.pcxpay.com/v1/payments-init/ramp",
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([
'fiat_currency' => 'NGN',
'fiat_amount' => 10000,
'client_rate' => 0.00000645,
'crypto_currency' => 'USDC',
'crypto_network' => 'ethereum',
'country' => 'NG',
'user_id' => '<string>',
'org_id' => '<string>',
'customer_type' => 'retail',
'business_id' => '<string>',
'business_name' => '<string>',
'wallet_address' => '0xABC123...your-wallet-address',
'mobile_money_details' => [
'provider' => 'MTN',
'phone_number' => '+2348122603628'
],
'bank_details' => [
'account_number' => '<string>',
'bank_code' => '<string>',
'bank_name' => '<string>'
],
'beneficiary_id' => '<string>',
'beneficiary_name' => '<string>',
'destination' => [
'accountNumber' => '<string>',
'bankCode' => '<string>',
'bankName' => '<string>'
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$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://prod-api.pcxpay.com/v1/payments-init/ramp"
payload := strings.NewReader("{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Api-Key", "<x-api-key>")
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://prod-api.pcxpay.com/v1/payments-init/ramp")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/payments-init/ramp")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiat_currency\": \"NGN\",\n \"fiat_amount\": 10000,\n \"client_rate\": 0.00000645,\n \"crypto_currency\": \"USDC\",\n \"crypto_network\": \"ethereum\",\n \"country\": \"NG\",\n \"user_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"customer_type\": \"retail\",\n \"business_id\": \"<string>\",\n \"business_name\": \"<string>\",\n \"wallet_address\": \"0xABC123...your-wallet-address\",\n \"mobile_money_details\": {\n \"provider\": \"MTN\",\n \"phone_number\": \"+2348122603628\"\n },\n \"bank_details\": {\n \"account_number\": \"<string>\",\n \"bank_code\": \"<string>\",\n \"bank_name\": \"<string>\"\n },\n \"beneficiary_id\": \"<string>\",\n \"beneficiary_name\": \"<string>\",\n \"destination\": {\n \"accountNumber\": \"<string>\",\n \"bankCode\": \"<string>\",\n \"bankName\": \"<string>\"\n },\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"response": {
"success": true,
"payment_id": "ea5965e4-1432-40ef-bccf-cb51455a935a",
"transaction_id": "2a679c96-69bf-424c-89cb-c2f4a90a2738",
"direction": "on_ramp",
"status": "pending",
"fiat_currency": "NGN",
"fiat_amount": 10000,
"crypto_currency": "USDC",
"crypto_network": "ethereum",
"crypto_amount": 6.45,
"provider": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"next_action": "make_transfer",
"payment_instructions": {
"type": "bank_transfer",
"account_name": "PCX Collections",
"account_number": "0123456789",
"bank_name": "Access Bank",
"amount": 10000,
"currency": "NGN",
"reference": "PCX-ea5965e4"
}
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}{
"error": "Rate has drifted. Please re-fetch the exchange rate.",
"message": "Rate has drifted. Please re-fetch the exchange rate.",
"code": "RATE_MISMATCH"
}Headers
Bearer JWT for user-facing flows (Bearer eyJraWQ...), or the literal string NONE when authenticating via API key.
"Bearer eyJraWQ..."
API key for server-to-server flows, or the literal string NONE when authenticating via JWT.
"pcx_abc123_xxxx"
Body
on_ramp — customer pays fiat, receives crypto to wallet_address. off_ramp — customer sends crypto, receives fiat to beneficiary.
on_ramp, off_ramp ISO 4217 fiat currency code (e.g. NGN, KES, GHS).
"NGN"
Amount in fiat currency — what the customer pays (on-ramp) or receives (off-ramp).
10000
The rate you fetched from GET /organizations/admin/exchange-rate and showed to the user. Validated against the current live rate on submission — must be within 0.5% or the request is rejected with RATE_MISMATCH.
0.00000645
Crypto asset code (e.g. USDC, USDT, EURC, BTC, ETH).
"USDC"
Blockchain network (e.g. ethereum, polygon, tron).
"ethereum"
Fiat payment method.
mobile_money, bank_transfer ISO alpha-2 country code of the fiat side (e.g. NG, KE).
"NG"
ID of the initiating user. Injected automatically from the authenticated API key or session — you do not need to include it.
Your organisation ID. Injected automatically from the authenticated API key or session — you do not need to include it.
Required for on_ramp.
Show child attributes
Show child attributes
Use institution for business customers. Requires business_id and business_name.
retail, institution Required when customer_type is institution.
Required when customer_type is institution.
Required for on_ramp. The destination crypto wallet address. PCX settles crypto here directly after fiat collection.
"0xABC123...your-wallet-address"
Required for mobile_money payment method.
Show child attributes
Show child attributes
On-ramp bank transfer — payer's source bank account.
Show child attributes
Show child attributes
Required for off_ramp. ID of the registered beneficiary receiving the fiat payout.
Required for off_ramp. Full name of the beneficiary.
Required for off_ramp. Destination routing details for the fiat payout.
Show child attributes
Show child attributes
Arbitrary key-value pairs included in webhook payloads.