curl --request POST \
--url https://api.paygentic.io/v0/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "<string>",
"consumerId": "<string>",
"taxId": "<string>",
"externalId": "<string>",
"taxRates": {}
}
'import requests
url = "https://api.paygentic.io/v0/customers"
payload = {
"merchantId": "<string>",
"consumerId": "<string>",
"taxId": "<string>",
"externalId": "<string>",
"taxRates": {}
}
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({
merchantId: '<string>',
consumerId: '<string>',
taxId: '<string>',
externalId: '<string>',
taxRates: {}
})
};
fetch('https://api.paygentic.io/v0/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.paygentic.io/v0/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([
'merchantId' => '<string>',
'consumerId' => '<string>',
'taxId' => '<string>',
'externalId' => '<string>',
'taxRates' => [
]
]),
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.paygentic.io/v0/customers"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\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.paygentic.io/v0/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/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 \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\n}"
response = http.request(request)
puts response.read_body{
"customerId": "cus_h3i4j5k6l7m8n9o0",
"validTaxAddress": {
"message": null,
"valid": true
}
}{
"customerId": "cus_h3i4j5k6l7m8n9o0",
"validTaxAddress": {
"message": null,
"valid": true
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Create
Create a new customer for a merchant organization. This endpoint is currently only used by the Paygentic platform as part of the subscription flow.
curl --request POST \
--url https://api.paygentic.io/v0/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantId": "<string>",
"consumerId": "<string>",
"taxId": "<string>",
"externalId": "<string>",
"taxRates": {}
}
'import requests
url = "https://api.paygentic.io/v0/customers"
payload = {
"merchantId": "<string>",
"consumerId": "<string>",
"taxId": "<string>",
"externalId": "<string>",
"taxRates": {}
}
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({
merchantId: '<string>',
consumerId: '<string>',
taxId: '<string>',
externalId: '<string>',
taxRates: {}
})
};
fetch('https://api.paygentic.io/v0/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.paygentic.io/v0/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([
'merchantId' => '<string>',
'consumerId' => '<string>',
'taxId' => '<string>',
'externalId' => '<string>',
'taxRates' => [
]
]),
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.paygentic.io/v0/customers"
payload := strings.NewReader("{\n \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\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.paygentic.io/v0/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/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 \"merchantId\": \"<string>\",\n \"consumerId\": \"<string>\",\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": {}\n}"
response = http.request(request)
puts response.read_body{
"customerId": "cus_h3i4j5k6l7m8n9o0",
"validTaxAddress": {
"message": null,
"valid": true
}
}{
"customerId": "cus_h3i4j5k6l7m8n9o0",
"validTaxAddress": {
"message": null,
"valid": true
}
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Authorizations
API key authentication
Body
The unique identifier for the merchant organization.
^org_[a-zA-Z0-9]+$Fields to create a new consumer. Will use an existing consumer if one exists with the same email address. Required if consumerId is not provided. Address with complete tax information (country, state, zipCode) is required for tax calculation when using Paygentic Tax.
Show child attributes
Show child attributes
The unique identifier for the consumer. Required if consumer is not provided.
^org_[a-zA-Z0-9]+$Optional business tax registration identifier. Sample values: 'GB123456789' for UK VAT, 'DE123456789' for German VAT, 'FR12345678901' for French VAT. Supplying this value enables inter-company tax handling and exemption from standard tax collection.
Merchant-defined identifier for this customer in their own system.
255An object mapping plan IDs, metric IDs, or 'default' to a tax rate percentage (e.g., 13 for 13%)
Show child attributes
Show child attributes
Response
Customer already exists
Was this page helpful?