curl
curl -X POST https://api.paybridgenp.com/v1/billing/customers \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Aarav Sharma",
"email": "aarav@example.com",
"externalCustomerId": "user_abc123"
}'import requests
url = "https://api.paybridgenp.com/v1/billing/customers"
payload = {
"name": "Aarav Sharma",
"email": "aarav@example.com",
"phone": "9801234567",
"externalCustomerId": "user_abc123",
"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({
name: 'Aarav Sharma',
email: 'aarav@example.com',
phone: '9801234567',
externalCustomerId: 'user_abc123',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/billing/customers', 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/billing/customers",
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([
'name' => 'Aarav Sharma',
'email' => 'aarav@example.com',
'phone' => '9801234567',
'externalCustomerId' => 'user_abc123',
'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/billing/customers"
payload := strings.NewReader("{\n \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\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/billing/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/billing/customers")
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 \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "bcu_01j9x2k3m4n5p6q7r8s9t0u1v2",
"object": "customer",
"name": "Aarav Sharma",
"email": "aarav@example.com",
"phone": "9801234567",
"external_customer_id": "<string>",
"credit_balance": 0,
"metadata": {},
"livemode": true
}{
"error": {
"message": "<string>",
"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>",
"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>"
}
}
}Customers
Create a customer
Creates a billing customer. Customers are required to create subscriptions.
POST
/
v1
/
billing
/
customers
curl
curl -X POST https://api.paybridgenp.com/v1/billing/customers \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Aarav Sharma",
"email": "aarav@example.com",
"externalCustomerId": "user_abc123"
}'import requests
url = "https://api.paybridgenp.com/v1/billing/customers"
payload = {
"name": "Aarav Sharma",
"email": "aarav@example.com",
"phone": "9801234567",
"externalCustomerId": "user_abc123",
"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({
name: 'Aarav Sharma',
email: 'aarav@example.com',
phone: '9801234567',
externalCustomerId: 'user_abc123',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/billing/customers', 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/billing/customers",
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([
'name' => 'Aarav Sharma',
'email' => 'aarav@example.com',
'phone' => '9801234567',
'externalCustomerId' => 'user_abc123',
'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/billing/customers"
payload := strings.NewReader("{\n \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\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/billing/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/billing/customers")
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 \"name\": \"Aarav Sharma\",\n \"email\": \"aarav@example.com\",\n \"phone\": \"9801234567\",\n \"externalCustomerId\": \"user_abc123\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "bcu_01j9x2k3m4n5p6q7r8s9t0u1v2",
"object": "customer",
"name": "Aarav Sharma",
"email": "aarav@example.com",
"phone": "9801234567",
"external_customer_id": "<string>",
"credit_balance": 0,
"metadata": {},
"livemode": true
}{
"error": {
"message": "<string>",
"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>",
"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
application/json
Response
Customer created.
Example:
"bcu_01j9x2k3m4n5p6q7r8s9t0u1v2"
String representing the object's type.
Available options:
customer Example:
"Aarav Sharma"
Example:
"aarav@example.com"
Example:
"9801234567"
Your internal customer ID for cross-referencing.
Account credit balance in paisa, applied to future invoices.
Example:
0
Arbitrary key-value pairs you attached.
true when created with a live key, false for sandbox.
Was this page helpful?
⌘I