curl -X POST https://api.paybridgenp.com/v1/qr/fonepay \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"customer": { "name": "Aarav Sharma", "email": "aarav@example.com" }
}'import requests
url = "https://api.paybridgenp.com/v1/qr/fonepay"
payload = {
"amount": 10000,
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"line2": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"currency": "NPR",
"metadata": {}
}
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: 10000,
customer: {
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: {
line1: '<string>',
city: '<string>',
line2: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>'
}
},
currency: 'NPR',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/qr/fonepay', 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://api.paybridgenp.com/v1/qr/fonepay",
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' => 10000,
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'line2' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>'
]
],
'currency' => 'NPR',
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paybridgenp.com/v1/qr/fonepay"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\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://api.paybridgenp.com/v1/qr/fonepay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/qr/fonepay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cs_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"amount": 10000,
"currency": "NPR",
"provider": "fonepay",
"status": "initiated",
"qr_message": "<string>",
"qr_image": "data:image/png;base64,iVBORw0KGgo...",
"events_url": "https://api.paybridgenp.com/v1/qr/cs_01j9x2k3m4n5p6q7r8s9t0u1v2/events",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Create a Fonepay Direct-QR session
Mints a Fonepay Dynamic QR server-side, skipping the hosted checkout page. Returns the QR string, a base64 PNG, and an SSE URL to listen for live status. Requires the payments:write scope.
In live mode, Direct-QR requires Pro or higher. In sandbox, it is available on every plan, but Fonepay sandbox payments can move real money and remain capped. A 403 forbidden with requiredPlan is returned when the mode-aware entitlement check fails.
Fonepay must be configured for the project (in the request’s mode). Subscribe to events_url to receive qr.scanned / qr.paid / qr.expired events.
curl -X POST https://api.paybridgenp.com/v1/qr/fonepay \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"customer": { "name": "Aarav Sharma", "email": "aarav@example.com" }
}'import requests
url = "https://api.paybridgenp.com/v1/qr/fonepay"
payload = {
"amount": 10000,
"customer": {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"address": {
"line1": "<string>",
"city": "<string>",
"line2": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"currency": "NPR",
"metadata": {}
}
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: 10000,
customer: {
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
address: {
line1: '<string>',
city: '<string>',
line2: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>'
}
},
currency: 'NPR',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/qr/fonepay', 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://api.paybridgenp.com/v1/qr/fonepay",
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' => 10000,
'customer' => [
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'address' => [
'line1' => '<string>',
'city' => '<string>',
'line2' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>'
]
],
'currency' => 'NPR',
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paybridgenp.com/v1/qr/fonepay"
payload := strings.NewReader("{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\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://api.paybridgenp.com/v1/qr/fonepay")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/qr/fonepay")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10000,\n \"customer\": {\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"address\": {\n \"line1\": \"<string>\",\n \"city\": \"<string>\",\n \"line2\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\"\n }\n },\n \"currency\": \"NPR\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "cs_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"amount": 10000,
"currency": "NPR",
"provider": "fonepay",
"status": "initiated",
"qr_message": "<string>",
"qr_image": "data:image/png;base64,iVBORw0KGgo...",
"events_url": "https://api.paybridgenp.com/v1/qr/cs_01j9x2k3m4n5p6q7r8s9t0u1v2/events",
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Authorizations
Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.
Body
Response
Direct-QR session created.
A Direct-QR session for Fonepay. Embed qr_image in your UI and subscribe to events_url for live status.
Session ID. Also the listener token for the SSE events stream.
"cs_01j9x2k3m4n5p6q7r8s9t0u1v2"
true when created with a live key, false for sandbox.
Amount in paisa.
10000
"NPR"
fonepay Always initiated on creation.
initiated Raw Fonepay QR payload string. Encode this if rendering your own QR.
Base64-encoded PNG data URL of the QR (320px).
"data:image/png;base64,iVBORw0KGgo..."
Server-Sent Events URL streaming qr.scanned / qr.paid / qr.expired events. No API key required - the session ID is the listener token.
"https://api.paybridgenp.com/v1/qr/cs_01j9x2k3m4n5p6q7r8s9t0u1v2/events"
When the Fonepay QR expires.
Was this page helpful?