Skip to main content
PATCH
/
v0
/
customers
/
{id}
Update
curl --request PATCH \
  --url https://api.paygentic.io/v0/customers/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "taxId": "<string>",
  "externalId": "<string>",
  "taxRates": 50,
  "notificationSettings": {
    "invoiceIssued": true,
    "invoicePaid": true,
    "renewalReminder": true
  }
}
'
import requests

url = "https://api.paygentic.io/v0/customers/{id}"

payload = {
"taxId": "<string>",
"externalId": "<string>",
"taxRates": 50,
"notificationSettings": {
"invoiceIssued": True,
"invoicePaid": True,
"renewalReminder": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
taxId: '<string>',
externalId: '<string>',
taxRates: 50,
notificationSettings: {invoiceIssued: true, invoicePaid: true, renewalReminder: true}
})
};

fetch('https://api.paygentic.io/v0/customers/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'taxId' => '<string>',
'externalId' => '<string>',
'taxRates' => 50,
'notificationSettings' => [
'invoiceIssued' => true,
'invoicePaid' => true,
'renewalReminder' => true
]
]),
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/{id}"

payload := strings.NewReader("{\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": 50,\n \"notificationSettings\": {\n \"invoiceIssued\": true,\n \"invoicePaid\": true,\n \"renewalReminder\": true\n }\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.paygentic.io/v0/customers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": 50,\n \"notificationSettings\": {\n \"invoiceIssued\": true,\n \"invoicePaid\": true,\n \"renewalReminder\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.paygentic.io/v0/customers/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"taxId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"taxRates\": 50,\n \"notificationSettings\": {\n \"invoiceIssued\": true,\n \"invoicePaid\": true,\n \"renewalReminder\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "cus_n5o6p7q8r9s0t1u2",
  "object": "customer",
  "consumerId": "org_v3w4x5y6z7a8b9c0",
  "createdAt": "2024-01-20T09:15:00Z",
  "merchantId": "org_d1e2f3g4h5i6j7k8",
  "taxId": "GB123456789",
  "taxRates": {
    "default": 10
  },
  "updatedAt": "2024-03-12T16:30:00Z",
  "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"
}
{
"message": "The requested resource was not found",
"error": "not_found"
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

id
string
required

The unique identifier of the customer. Unique identifier for a customer

Pattern: ^cus_[a-zA-Z0-9]+$

Body

application/json
taxId
string | null

Business tax registration identifier. Sample values: 'GB123456789' for UK VAT, 'DE123456789' for German VAT, 'FR12345678901' for French VAT. Enables inter-company tax handling and exemption from standard tax collection. Assign null to delete the identifier.

externalId
string | null

Merchant-defined identifier for this customer in their own system. Set to null to clear.

Maximum string length: 255
taxRates

Single tax rate percentage applied across all plans and metrics. Sample values: '8.5' represents 8.5% tax rate, '12.1' represents 12.1% tax rate, '0' represents no tax

Required range: 0 <= x <= 100
notificationSettings
object

Notification preferences for this customer. Only provided fields are updated.

Response

Customer updated successfully

id
string
required

Unique identifier for a customer

Pattern: ^cus_[a-zA-Z0-9]+$
object
enum<string>
default:customer
required
Available options:
customer
consumerId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
createdAt
string<date-time>
required
merchantId
string
required

Unique identifier for an organization

Pattern: ^org_[a-zA-Z0-9]+$
updatedAt
string<date-time>
required
validTaxAddress
object
required

Indicates whether the consumer address is valid for tax calculation when using Paygentic Tax. If valid=false, tax calculation will be skipped and internal invoice flow with default tax rate will be used.

organization
object
taxId
string

Business tax registration identifier. Sample values: 'GB123456789' for UK VAT, 'DE123456789' for German VAT, 'FR12345678901' for French VAT. Enables inter-company tax handling and exemption from standard tax collection.

externalId
string

Merchant-defined identifier for this customer in their own system.

Maximum string length: 255
taxRates
object

An object mapping plan IDs, metric IDs, or 'default' to a tax rate percentage (e.g., 13 for 13%)

notificationSettings
object