Onboard a customer
curl --request POST \
--url https://prod-api.pcxpay.com/v1/virtual-accounts/onboard \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"org_id": "<string>",
"user_id": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"initial_balance": 123
}
'import requests
url = "https://prod-api.pcxpay.com/v1/virtual-accounts/onboard"
payload = {
"org_id": "<string>",
"user_id": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"initial_balance": 123
}
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({
org_id: '<string>',
user_id: '<string>',
email: 'jsmith@example.com',
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
initial_balance: 123
})
};
fetch('https://prod-api.pcxpay.com/v1/virtual-accounts/onboard', 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/virtual-accounts/onboard",
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([
'org_id' => '<string>',
'user_id' => '<string>',
'email' => 'jsmith@example.com',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'initial_balance' => 123
]),
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/virtual-accounts/onboard"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\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/virtual-accounts/onboard")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/virtual-accounts/onboard")
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 \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"account_id": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"currency": "<string>",
"balance": 123,
"ledger_balance": 123,
"account_number": "<string>",
"bank_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Onboarding
Onboard a customer
Second step of customer onboarding. Submit the full customer profile once the customer has accepted the Terms of Service.
POST
/
virtual-accounts
/
onboard
Onboard a customer
curl --request POST \
--url https://prod-api.pcxpay.com/v1/virtual-accounts/onboard \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"org_id": "<string>",
"user_id": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"initial_balance": 123
}
'import requests
url = "https://prod-api.pcxpay.com/v1/virtual-accounts/onboard"
payload = {
"org_id": "<string>",
"user_id": "<string>",
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>",
"phone": "<string>",
"initial_balance": 123
}
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({
org_id: '<string>',
user_id: '<string>',
email: 'jsmith@example.com',
first_name: '<string>',
last_name: '<string>',
phone: '<string>',
initial_balance: 123
})
};
fetch('https://prod-api.pcxpay.com/v1/virtual-accounts/onboard', 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/virtual-accounts/onboard",
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([
'org_id' => '<string>',
'user_id' => '<string>',
'email' => 'jsmith@example.com',
'first_name' => '<string>',
'last_name' => '<string>',
'phone' => '<string>',
'initial_balance' => 123
]),
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/virtual-accounts/onboard"
payload := strings.NewReader("{\n \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\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/virtual-accounts/onboard")
.header("Authorization", "<authorization>")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.pcxpay.com/v1/virtual-accounts/onboard")
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 \"org_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone\": \"<string>\",\n \"initial_balance\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"data": {
"account_id": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"currency": "<string>",
"balance": 123,
"ledger_balance": 123,
"account_number": "<string>",
"bank_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Headers
Bearer JWT for user-facing flows (Bearer eyJraWQ...), or the literal string NONE when authenticating via API key.
Example:
"Bearer eyJraWQ..."
API key for server-to-server flows, or the literal string NONE when authenticating via JWT.
Example:
"pcx_abc123_xxxx"
Body
application/json
⌘I