Initiate Payment Intent
curl --request POST \
--url https://{brand_domain}/api/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "500.00",
"currency": "BDT",
"callback_url": "https://my-store.com/webhooks/pycer",
"redirect_url": "https://my-store.com/checkout/success",
"cancel_url": "https://my-store.com/checkout/cancel",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"customer_phone": "+8801700000000",
"reference": "INV-10029",
"gateway": "bkash-merchant",
"metadata": {
"store_id": "dhaka-branch",
"item_categories": [
"electronics",
"peripherals"
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{brand_domain}/api/v1/payments",
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' => '500.00',
'currency' => 'BDT',
'callback_url' => 'https://my-store.com/webhooks/pycer',
'redirect_url' => 'https://my-store.com/checkout/success',
'cancel_url' => 'https://my-store.com/checkout/cancel',
'customer_email' => 'customer@example.com',
'customer_name' => 'John Doe',
'customer_phone' => '+8801700000000',
'reference' => 'INV-10029',
'gateway' => 'bkash-merchant',
'metadata' => [
'store_id' => 'dhaka-branch',
'item_categories' => [
'electronics',
'peripherals'
]
]
]),
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;
}import requests
url = "https://{brand_domain}/api/v1/payments"
payload = {
"amount": "500.00",
"currency": "BDT",
"callback_url": "https://my-store.com/webhooks/pycer",
"redirect_url": "https://my-store.com/checkout/success",
"cancel_url": "https://my-store.com/checkout/cancel",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"customer_phone": "+8801700000000",
"reference": "INV-10029",
"gateway": "bkash-merchant",
"metadata": {
"store_id": "dhaka-branch",
"item_categories": ["electronics", "peripherals"]
}
}
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({
amount: '500.00',
currency: 'BDT',
callback_url: 'https://my-store.com/webhooks/pycer',
redirect_url: 'https://my-store.com/checkout/success',
cancel_url: 'https://my-store.com/checkout/cancel',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
customer_phone: '+8801700000000',
reference: 'INV-10029',
gateway: 'bkash-merchant',
metadata: {store_id: 'dhaka-branch', item_categories: ['electronics', 'peripherals']}
})
};
fetch('https://{brand_domain}/api/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{brand_domain}/api/v1/payments"
payload := strings.NewReader("{\n \"amount\": \"500.00\",\n \"currency\": \"BDT\",\n \"callback_url\": \"https://my-store.com/webhooks/pycer\",\n \"redirect_url\": \"https://my-store.com/checkout/success\",\n \"cancel_url\": \"https://my-store.com/checkout/cancel\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"customer_phone\": \"+8801700000000\",\n \"reference\": \"INV-10029\",\n \"gateway\": \"bkash-merchant\",\n \"metadata\": {\n \"store_id\": \"dhaka-branch\",\n \"item_categories\": [\n \"electronics\",\n \"peripherals\"\n ]\n }\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://{brand_domain}/api/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"500.00\",\n \"currency\": \"BDT\",\n \"callback_url\": \"https://my-store.com/webhooks/pycer\",\n \"redirect_url\": \"https://my-store.com/checkout/success\",\n \"cancel_url\": \"https://my-store.com/checkout/cancel\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"customer_phone\": \"+8801700000000\",\n \"reference\": \"INV-10029\",\n \"gateway\": \"bkash-merchant\",\n \"metadata\": {\n \"store_id\": \"dhaka-branch\",\n \"item_categories\": [\n \"electronics\",\n \"peripherals\"\n ]\n }\n}")
.asString();const url = 'https://{brand_domain}/api/v1/payments';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '500.00',
currency: 'BDT',
callback_url: 'https://my-store.com/webhooks/pycer',
redirect_url: 'https://my-store.com/checkout/success',
cancel_url: 'https://my-store.com/checkout/cancel',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
customer_phone: '+8801700000000',
reference: 'INV-10029',
gateway: 'bkash-merchant',
metadata: {store_id: 'dhaka-branch', item_categories: ['electronics', 'peripherals']}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"success": true,
"data": {
"payment_id": "a810b445-564a-4e20-80a5-f1261d7b328a",
"token": "tok_4821a8f902bd3f46",
"checkout_url": "https://pycer.quantivogroup.com/checkout/tok_4821a8f902bd3f46",
"status": "created"
}
}{
"success": false,
"error": "amount must be a positive number",
"errors": [
{
"code": "INVALID_AMOUNT",
"message": "amount must be a positive number",
"field": "amount"
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}API Reference
Initiate Payment Intent
Initiates a new payment session by creating a payment intent. Returns a secure, white-labeled checkout URL where customers can choose from the brand’s active payment methods (such as Mobile Financial Services (MFS) e.g., bKash, Nagad, Rocket). Validates callback URLs against transport safety regulations, truncates customer PII properties to fit database constraints, and resolves/creates customer profile bindings.
POST
https://{brand_domain}/api/v1
/
payments
Initiate Payment Intent
curl --request POST \
--url https://{brand_domain}/api/v1/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "500.00",
"currency": "BDT",
"callback_url": "https://my-store.com/webhooks/pycer",
"redirect_url": "https://my-store.com/checkout/success",
"cancel_url": "https://my-store.com/checkout/cancel",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"customer_phone": "+8801700000000",
"reference": "INV-10029",
"gateway": "bkash-merchant",
"metadata": {
"store_id": "dhaka-branch",
"item_categories": [
"electronics",
"peripherals"
]
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{brand_domain}/api/v1/payments",
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' => '500.00',
'currency' => 'BDT',
'callback_url' => 'https://my-store.com/webhooks/pycer',
'redirect_url' => 'https://my-store.com/checkout/success',
'cancel_url' => 'https://my-store.com/checkout/cancel',
'customer_email' => 'customer@example.com',
'customer_name' => 'John Doe',
'customer_phone' => '+8801700000000',
'reference' => 'INV-10029',
'gateway' => 'bkash-merchant',
'metadata' => [
'store_id' => 'dhaka-branch',
'item_categories' => [
'electronics',
'peripherals'
]
]
]),
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;
}import requests
url = "https://{brand_domain}/api/v1/payments"
payload = {
"amount": "500.00",
"currency": "BDT",
"callback_url": "https://my-store.com/webhooks/pycer",
"redirect_url": "https://my-store.com/checkout/success",
"cancel_url": "https://my-store.com/checkout/cancel",
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"customer_phone": "+8801700000000",
"reference": "INV-10029",
"gateway": "bkash-merchant",
"metadata": {
"store_id": "dhaka-branch",
"item_categories": ["electronics", "peripherals"]
}
}
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({
amount: '500.00',
currency: 'BDT',
callback_url: 'https://my-store.com/webhooks/pycer',
redirect_url: 'https://my-store.com/checkout/success',
cancel_url: 'https://my-store.com/checkout/cancel',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
customer_phone: '+8801700000000',
reference: 'INV-10029',
gateway: 'bkash-merchant',
metadata: {store_id: 'dhaka-branch', item_categories: ['electronics', 'peripherals']}
})
};
fetch('https://{brand_domain}/api/v1/payments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{brand_domain}/api/v1/payments"
payload := strings.NewReader("{\n \"amount\": \"500.00\",\n \"currency\": \"BDT\",\n \"callback_url\": \"https://my-store.com/webhooks/pycer\",\n \"redirect_url\": \"https://my-store.com/checkout/success\",\n \"cancel_url\": \"https://my-store.com/checkout/cancel\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"customer_phone\": \"+8801700000000\",\n \"reference\": \"INV-10029\",\n \"gateway\": \"bkash-merchant\",\n \"metadata\": {\n \"store_id\": \"dhaka-branch\",\n \"item_categories\": [\n \"electronics\",\n \"peripherals\"\n ]\n }\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://{brand_domain}/api/v1/payments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"500.00\",\n \"currency\": \"BDT\",\n \"callback_url\": \"https://my-store.com/webhooks/pycer\",\n \"redirect_url\": \"https://my-store.com/checkout/success\",\n \"cancel_url\": \"https://my-store.com/checkout/cancel\",\n \"customer_email\": \"customer@example.com\",\n \"customer_name\": \"John Doe\",\n \"customer_phone\": \"+8801700000000\",\n \"reference\": \"INV-10029\",\n \"gateway\": \"bkash-merchant\",\n \"metadata\": {\n \"store_id\": \"dhaka-branch\",\n \"item_categories\": [\n \"electronics\",\n \"peripherals\"\n ]\n }\n}")
.asString();const url = 'https://{brand_domain}/api/v1/payments';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '500.00',
currency: 'BDT',
callback_url: 'https://my-store.com/webhooks/pycer',
redirect_url: 'https://my-store.com/checkout/success',
cancel_url: 'https://my-store.com/checkout/cancel',
customer_email: 'customer@example.com',
customer_name: 'John Doe',
customer_phone: '+8801700000000',
reference: 'INV-10029',
gateway: 'bkash-merchant',
metadata: {store_id: 'dhaka-branch', item_categories: ['electronics', 'peripherals']}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"success": true,
"data": {
"payment_id": "a810b445-564a-4e20-80a5-f1261d7b328a",
"token": "tok_4821a8f902bd3f46",
"checkout_url": "https://pycer.quantivogroup.com/checkout/tok_4821a8f902bd3f46",
"status": "created"
}
}{
"success": false,
"error": "amount must be a positive number",
"errors": [
{
"code": "INVALID_AMOUNT",
"message": "amount must be a positive number",
"field": "amount"
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}{
"success": false,
"error": "Payment not found",
"errors": [
{
"code": "PAYMENT_NOT_FOUND",
"message": "Payment not found",
"field": null
}
],
"request_id": "8f5a2e9b0c7d4e5f"
}Body
application/json