Create pay-in
curl --request POST \
--url https://sandbox.api.payvehq.com/v1/payins \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 100000,
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"merchantReference": "<string>",
"phone": "+2348012345678",
"callbackUrl": "https://merchant.example.com/payins/callback",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 100000,
customer: {name: '<string>', email: '<string>', phone: '<string>'},
merchantReference: '<string>',
phone: '+2348012345678',
callbackUrl: 'https://merchant.example.com/payins/callback',
metadata: {}
})
};
fetch('https://sandbox.api.payvehq.com/v1/payins', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.payvehq.com/v1/payins"
payload = {
"amount": 100000,
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"merchantReference": "<string>",
"phone": "+2348012345678",
"callbackUrl": "https://merchant.example.com/payins/callback",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.payvehq.com/v1/payins",
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([
'amount' => 100000,
'customer' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '<string>'
],
'merchantReference' => '<string>',
'phone' => '+2348012345678',
'callbackUrl' => 'https://merchant.example.com/payins/callback',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Collections
Create pay-in
Ask a customer to pay you. Returns the details the customer pays to.
POST
/
v1
/
payins
Create pay-in
curl --request POST \
--url https://sandbox.api.payvehq.com/v1/payins \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 100000,
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"merchantReference": "<string>",
"phone": "+2348012345678",
"callbackUrl": "https://merchant.example.com/payins/callback",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 100000,
customer: {name: '<string>', email: '<string>', phone: '<string>'},
merchantReference: '<string>',
phone: '+2348012345678',
callbackUrl: 'https://merchant.example.com/payins/callback',
metadata: {}
})
};
fetch('https://sandbox.api.payvehq.com/v1/payins', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.payvehq.com/v1/payins"
payload = {
"amount": 100000,
"customer": {
"name": "<string>",
"email": "<string>",
"phone": "<string>"
},
"merchantReference": "<string>",
"phone": "+2348012345678",
"callbackUrl": "https://merchant.example.com/payins/callback",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.api.payvehq.com/v1/payins",
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([
'amount' => 100000,
'customer' => [
'name' => '<string>',
'email' => '<string>',
'phone' => '<string>'
],
'merchantReference' => '<string>',
'phone' => '+2348012345678',
'callbackUrl' => 'https://merchant.example.com/payins/callback',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Body
application/json
Response
202
Payin initiated

