curl
curl -X POST https://api.paybridgenp.com/v1/payment-links \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "title": "Donation", "amount": 10000 }'import requests
url = "https://api.paybridgenp.com/v1/payment-links"
payload = {
"title": "Donation",
"description": "<string>",
"amount": 10000,
"minAmount": 123,
"maxAmount": 123,
"currency": "NPR",
"maxUses": 5000,
"expiresAt": "2023-11-07T05:31:56Z",
"redirectUrl": "<string>",
"inactiveMessage": "<string>",
"metadata": {},
"customerName": "<string>",
"customerEmail": "jsmith@example.com",
"customerPhone": "<string>",
"referenceId": "<string>",
"collectAddress": True,
"buyerFieldOverrides": { "fields": {} }
}
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({
title: 'Donation',
description: '<string>',
amount: 10000,
minAmount: 123,
maxAmount: 123,
currency: 'NPR',
maxUses: 5000,
expiresAt: '2023-11-07T05:31:56Z',
redirectUrl: '<string>',
inactiveMessage: '<string>',
metadata: {},
customerName: '<string>',
customerEmail: 'jsmith@example.com',
customerPhone: '<string>',
referenceId: '<string>',
collectAddress: true,
buyerFieldOverrides: {fields: {}}
})
};
fetch('https://api.paybridgenp.com/v1/payment-links', 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/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' => 'Donation',
'description' => '<string>',
'amount' => 10000,
'minAmount' => 123,
'maxAmount' => 123,
'currency' => 'NPR',
'maxUses' => 5000,
'expiresAt' => '2023-11-07T05:31:56Z',
'redirectUrl' => '<string>',
'inactiveMessage' => '<string>',
'metadata' => [
],
'customerName' => '<string>',
'customerEmail' => 'jsmith@example.com',
'customerPhone' => '<string>',
'referenceId' => '<string>',
'collectAddress' => true,
'buyerFieldOverrides' => [
'fields' => [
]
]
]),
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/payment-links"
payload := strings.NewReader("{\n \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\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://api.paybridgenp.com/v1/payment-links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/payment-links")
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 \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "lnk_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"mode": "sandbox",
"title": "Donation",
"description": "<string>",
"amount": 10000,
"minAmount": 123,
"maxAmount": 123,
"currency": "NPR",
"provider": "esewa",
"active": true,
"maxUses": 123,
"usedCount": 0,
"expiresAt": "2023-11-07T05:31:56Z",
"redirectUrl": "<string>",
"inactiveMessage": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"customerPhone": "<string>",
"collectAddress": true,
"buyerFieldOverrides": {
"fields": {
"name": "required",
"email": "required",
"phone": "required"
},
"contactRequirement": "email_or_phone"
},
"customerLine1": "<string>",
"customerLine2": "<string>",
"customerCity": "<string>",
"customerState": "<string>",
"customerPostalCode": "<string>",
"customerCountry": "<string>",
"referenceId": "<string>",
"metadata": {},
"url": "https://paybridgenp.com/pay/lnk_01j9x2k3m4n5p6q7r8s9t0u1v2",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Payment Links
Create a payment link
Creates a reusable hosted payment page. Requires the links:write scope. Provide either a fixed amount, or minAmount/maxAmount bounds for a customer-entered amount.
POST
/
v1
/
payment-links
curl
curl -X POST https://api.paybridgenp.com/v1/payment-links \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "title": "Donation", "amount": 10000 }'import requests
url = "https://api.paybridgenp.com/v1/payment-links"
payload = {
"title": "Donation",
"description": "<string>",
"amount": 10000,
"minAmount": 123,
"maxAmount": 123,
"currency": "NPR",
"maxUses": 5000,
"expiresAt": "2023-11-07T05:31:56Z",
"redirectUrl": "<string>",
"inactiveMessage": "<string>",
"metadata": {},
"customerName": "<string>",
"customerEmail": "jsmith@example.com",
"customerPhone": "<string>",
"referenceId": "<string>",
"collectAddress": True,
"buyerFieldOverrides": { "fields": {} }
}
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({
title: 'Donation',
description: '<string>',
amount: 10000,
minAmount: 123,
maxAmount: 123,
currency: 'NPR',
maxUses: 5000,
expiresAt: '2023-11-07T05:31:56Z',
redirectUrl: '<string>',
inactiveMessage: '<string>',
metadata: {},
customerName: '<string>',
customerEmail: 'jsmith@example.com',
customerPhone: '<string>',
referenceId: '<string>',
collectAddress: true,
buyerFieldOverrides: {fields: {}}
})
};
fetch('https://api.paybridgenp.com/v1/payment-links', 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/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' => 'Donation',
'description' => '<string>',
'amount' => 10000,
'minAmount' => 123,
'maxAmount' => 123,
'currency' => 'NPR',
'maxUses' => 5000,
'expiresAt' => '2023-11-07T05:31:56Z',
'redirectUrl' => '<string>',
'inactiveMessage' => '<string>',
'metadata' => [
],
'customerName' => '<string>',
'customerEmail' => 'jsmith@example.com',
'customerPhone' => '<string>',
'referenceId' => '<string>',
'collectAddress' => true,
'buyerFieldOverrides' => [
'fields' => [
]
]
]),
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/payment-links"
payload := strings.NewReader("{\n \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\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://api.paybridgenp.com/v1/payment-links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/payment-links")
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 \"title\": \"Donation\",\n \"description\": \"<string>\",\n \"amount\": 10000,\n \"minAmount\": 123,\n \"maxAmount\": 123,\n \"currency\": \"NPR\",\n \"maxUses\": 5000,\n \"expiresAt\": \"2023-11-07T05:31:56Z\",\n \"redirectUrl\": \"<string>\",\n \"inactiveMessage\": \"<string>\",\n \"metadata\": {},\n \"customerName\": \"<string>\",\n \"customerEmail\": \"jsmith@example.com\",\n \"customerPhone\": \"<string>\",\n \"referenceId\": \"<string>\",\n \"collectAddress\": true,\n \"buyerFieldOverrides\": {\n \"fields\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "lnk_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"mode": "sandbox",
"title": "Donation",
"description": "<string>",
"amount": 10000,
"minAmount": 123,
"maxAmount": 123,
"currency": "NPR",
"provider": "esewa",
"active": true,
"maxUses": 123,
"usedCount": 0,
"expiresAt": "2023-11-07T05:31:56Z",
"redirectUrl": "<string>",
"inactiveMessage": "<string>",
"customerName": "<string>",
"customerEmail": "<string>",
"customerPhone": "<string>",
"collectAddress": true,
"buyerFieldOverrides": {
"fields": {
"name": "required",
"email": "required",
"phone": "required"
},
"contactRequirement": "email_or_phone"
},
"customerLine1": "<string>",
"customerLine2": "<string>",
"customerCity": "<string>",
"customerState": "<string>",
"customerPostalCode": "<string>",
"customerCountry": "<string>",
"referenceId": "<string>",
"metadata": {},
"url": "https://paybridgenp.com/pay/lnk_01j9x2k3m4n5p6q7r8s9t0u1v2",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"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",
"detail": "<string>",
"refund": {
"id": "ref_01j9x2k3m4n5p6q7r8s9t0u1v2",
"livemode": true,
"paymentId": "pay_01j9x2k3m4n5p6q7r8s9t0u1v2",
"projectId": "<string>",
"mode": "sandbox",
"amount": 10000,
"currency": "NPR",
"reason": "customer_request",
"status": "processing",
"providerRefundId": "<string>",
"failureReason": "<string>",
"notes": "<string>",
"mobileNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Authorizations
Headers
Body
application/json
Response
Payment link created.
Was this page helpful?