Create link
curl --request POST \
--url https://sandbox.api.payvehq.com/v1/payment-links \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"currency": "NGN",
"description": "<string>",
"amount": 2,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {},
"overpaymentTolerance": 1,
"underpaymentTolerance": 1,
"redirectUrl": "<string>",
"allowedMethods": []
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
currency: 'NGN',
description: '<string>',
amount: 2,
expiresAt: '2023-11-07T05:31:56Z',
metadata: {},
overpaymentTolerance: 1,
underpaymentTolerance: 1,
redirectUrl: '<string>',
allowedMethods: []
})
};
fetch('https://sandbox.api.payvehq.com/v1/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.payvehq.com/v1/payment-links"
payload = {
"title": "<string>",
"currency": "NGN",
"description": "<string>",
"amount": 2,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {},
"overpaymentTolerance": 1,
"underpaymentTolerance": 1,
"redirectUrl": "<string>",
"allowedMethods": []
}
headers = {
"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/payment-links",
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([
'title' => '<string>',
'currency' => 'NGN',
'description' => '<string>',
'amount' => 2,
'expiresAt' => '2023-11-07T05:31:56Z',
'metadata' => [
],
'overpaymentTolerance' => 1,
'underpaymentTolerance' => 1,
'redirectUrl' => '<string>',
'allowedMethods' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}Payment links
Create link
Create a link to a hosted payment page you can share with a customer.
POST
/
v1
/
payment-links
Create link
curl --request POST \
--url https://sandbox.api.payvehq.com/v1/payment-links \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"currency": "NGN",
"description": "<string>",
"amount": 2,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {},
"overpaymentTolerance": 1,
"underpaymentTolerance": 1,
"redirectUrl": "<string>",
"allowedMethods": []
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
currency: 'NGN',
description: '<string>',
amount: 2,
expiresAt: '2023-11-07T05:31:56Z',
metadata: {},
overpaymentTolerance: 1,
underpaymentTolerance: 1,
redirectUrl: '<string>',
allowedMethods: []
})
};
fetch('https://sandbox.api.payvehq.com/v1/payment-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.payvehq.com/v1/payment-links"
payload = {
"title": "<string>",
"currency": "NGN",
"description": "<string>",
"amount": 2,
"expiresAt": "2023-11-07T05:31:56Z",
"metadata": {},
"overpaymentTolerance": 1,
"underpaymentTolerance": 1,
"redirectUrl": "<string>",
"allowedMethods": []
}
headers = {
"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/payment-links",
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([
'title' => '<string>',
'currency' => 'NGN',
'description' => '<string>',
'amount' => 2,
'expiresAt' => '2023-11-07T05:31:56Z',
'metadata' => [
],
'overpaymentTolerance' => 1,
'underpaymentTolerance' => 1,
'redirectUrl' => '<string>',
'allowedMethods' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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
201
Payment link created

