Update a customer
Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
curl --request PATCH \
--url https://sandbox-api.paynext.com/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"address": {
"city": "San Francisco",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"email": "jane.doe@example.com",
"full_name": "Jane Doe",
"metadata": {
"key": "value"
},
"phone": "+1234567890"
}
'const options = {
method: 'PATCH',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: {
city: 'San Francisco',
line1: '123 Market Street',
line2: 'Suite 400',
postal_code: '94105',
state: 'CA'
},
email: 'jane.doe@example.com',
full_name: 'Jane Doe',
metadata: {key: 'value'},
phone: '+1234567890'
})
};
fetch('https://sandbox-api.paynext.com/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.paynext.com/customers/{id}"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"San Francisco\",\n \"line1\": \"123 Market Street\",\n \"line2\": \"Suite 400\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": \"jane.doe@example.com\",\n \"full_name\": \"Jane Doe\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"phone\": \"+1234567890\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
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://sandbox-api.paynext.com/customers/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"San Francisco\",\n \"line1\": \"123 Market Street\",\n \"line2\": \"Suite 400\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": \"jane.doe@example.com\",\n \"full_name\": \"Jane Doe\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"phone\": \"+1234567890\"\n}")
.asString();import requests
url = "https://sandbox-api.paynext.com/customers/{id}"
payload = {
"address": {
"city": "San Francisco",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"email": "jane.doe@example.com",
"full_name": "Jane Doe",
"metadata": { "key": "value" },
"phone": "+1234567890"
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.paynext.com/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([
'address' => [
'city' => 'San Francisco',
'line1' => '123 Market Street',
'line2' => 'Suite 400',
'postal_code' => '94105',
'state' => 'CA'
],
'email' => 'jane.doe@example.com',
'full_name' => 'Jane Doe',
'metadata' => [
'key' => 'value'
],
'phone' => '+1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "customer",
"id": "cus_b8d0fe7e-3a7f-4b5f-a68b-d31358b49c3f",
"email": "alice.johnson@example.com",
"external_id": "ext_001",
"full_name": "Alice Johnson",
"phone": "+1-555-123-4567",
"created_at": "2025-05-28T14:00:00Z",
"updated_at": "2025-05-28T14:05:00Z",
"metadata": {
"tier": "premium"
},
"address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"payment_methods": [
{
"type": "CARD",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"bin": "411111",
"last4": "1111",
"exp_month": 12,
"exp_year": 2028,
"is_network_tokenized": true,
"number": "4111111111111111",
"bin_data": {
"brand": "visa",
"country": "US",
"currency_code": "USD",
"description": "Chase Sapphire Preferred",
"funding": "credit",
"issuer": "Chase Bank",
"type": "consumer"
}
}
},
{
"type": "PAYPAL",
"details": {
"payer_info": {
"email": "alice.johnson@example.com",
"first_name": "Alice",
"last_name": "Johnson",
"payer_id": "PAYER12345",
"tenant": "Tenant"
},
"processor_customer_email": "alice.johnson@example.com",
"processor_customer_id": "cus_pp_1234567890",
"processor_payment_method_id": "pm_pp_1234567890"
}
},
{
"type": "VENMO",
"details": {
"processor_payment_method_id": "pm_venmo_1234567890"
}
},
{
"type": "CASHAPP",
"details": {
"processor_customer_id": "cus_ca_1234567890",
"processor_payment_method_id": "pm_ca_1234567890"
}
},
{
"type": "APPLEPAY",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"token": "ap_token_12345678",
"token_exp_month": 12,
"token_exp_year": 2028,
"token_service_provider": "APPLE"
}
},
{
"type": "GPAY",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"token": "gp_token_12345678",
"token_exp_month": 12,
"token_exp_year": 2028,
"token_service_provider": "GOOGLE"
}
}
],
"subscriptions": [
{
"id": "sub_123e4567-e89b-12d3-a456-426614174000",
"status": "active",
"created_at": "2025-05-26T10:00:00Z",
"updated_at": "2025-05-27T10:00:00Z",
"current_period_start": "2025-05-26T10:00:00Z",
"current_period_end": "2025-06-26T10:00:00Z",
"cancelled_at": null,
"cancellation_details": {
"reason": null,
"trigger_payment_id": null
},
"next_billing_date": "2025-06-26T12:00:00Z",
"past_due": {
"attempt_count": 0,
"max_attempts_count": 7
},
"plan": {
"id": "price_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"name": "Pro Plan",
"type": "recurring",
"interval": "months",
"interval_count": 1,
"trial_interval": "days",
"trial_interval_count": 14,
"price": {
"amount": 1999,
"currency": "USD"
},
"trial_price": {
"amount": 0,
"currency": "USD"
},
"tax": {
"collect_tax": "DEFAULT"
}
},
"metadata": {
"key": "value"
}
}
]
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}Authorizations
Authentication header of the form api key, where api key is your organization api key.
Headers
Specifies the version of the API to use
2.0.0 Path Parameters
The ID of the customer to update
Body
Update customer data
Address information of the customer
Show child attributes
Show child attributes
Email address of the customer
"jane.doe@example.com"
Full name of the customer
"Jane Doe"
Custom metadata associated with the customer A dictionary of key-value pairs. (fingerprint field in metadata is not editable)
Show child attributes
Show child attributes
{ "key": "value" }
Phone number of the customer
"+1234567890"
Response
Returns the updated customer object.
Unique identifier
"cus_b8d0fe7e-3a7f-4b5f-a68b-d31358b49c3f"
Address associated with customer
Show child attributes
Show child attributes
Email of the customer
"alice.johnson@example.com"
External ID of the customer
"ext_001"
Full name of the customer
"Alice Johnson"
Customer's phone number
"+1-555-123-4567"
Customer's saved payment methods.
- Card API Schema
- PayPal API Schema
- Venmo API Schema
- CashApp API Schema
- Apple Pay API Schema
- Google Pay API Schema
Show child attributes
Show child attributes
Customer's subscriptions with plan details.
Show child attributes
Show child attributes
Additional metadata as a JSON object
Show child attributes
Show child attributes
{ "key": "value" }
The date and time the customer was created in UTC format
"2025-05-28T14:00:00Z"
The date and time the customer was last updated in UTC format
"2025-05-28T14:05:00Z"
Was this page helpful?
curl --request PATCH \
--url https://sandbox-api.paynext.com/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-API-Version: <x-api-version>' \
--data '
{
"address": {
"city": "San Francisco",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"email": "jane.doe@example.com",
"full_name": "Jane Doe",
"metadata": {
"key": "value"
},
"phone": "+1234567890"
}
'const options = {
method: 'PATCH',
headers: {
'X-API-Version': '<x-api-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: {
city: 'San Francisco',
line1: '123 Market Street',
line2: 'Suite 400',
postal_code: '94105',
state: 'CA'
},
email: 'jane.doe@example.com',
full_name: 'Jane Doe',
metadata: {key: 'value'},
phone: '+1234567890'
})
};
fetch('https://sandbox-api.paynext.com/customers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox-api.paynext.com/customers/{id}"
payload := strings.NewReader("{\n \"address\": {\n \"city\": \"San Francisco\",\n \"line1\": \"123 Market Street\",\n \"line2\": \"Suite 400\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": \"jane.doe@example.com\",\n \"full_name\": \"Jane Doe\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"phone\": \"+1234567890\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Version", "<x-api-version>")
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://sandbox-api.paynext.com/customers/{id}")
.header("X-API-Version", "<x-api-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": {\n \"city\": \"San Francisco\",\n \"line1\": \"123 Market Street\",\n \"line2\": \"Suite 400\",\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": \"jane.doe@example.com\",\n \"full_name\": \"Jane Doe\",\n \"metadata\": {\n \"key\": \"value\"\n },\n \"phone\": \"+1234567890\"\n}")
.asString();import requests
url = "https://sandbox-api.paynext.com/customers/{id}"
payload = {
"address": {
"city": "San Francisco",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"email": "jane.doe@example.com",
"full_name": "Jane Doe",
"metadata": { "key": "value" },
"phone": "+1234567890"
}
headers = {
"X-API-Version": "<x-api-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox-api.paynext.com/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([
'address' => [
'city' => 'San Francisco',
'line1' => '123 Market Street',
'line2' => 'Suite 400',
'postal_code' => '94105',
'state' => 'CA'
],
'email' => 'jane.doe@example.com',
'full_name' => 'Jane Doe',
'metadata' => [
'key' => 'value'
],
'phone' => '+1234567890'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-API-Version: <x-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "customer",
"id": "cus_b8d0fe7e-3a7f-4b5f-a68b-d31358b49c3f",
"email": "alice.johnson@example.com",
"external_id": "ext_001",
"full_name": "Alice Johnson",
"phone": "+1-555-123-4567",
"created_at": "2025-05-28T14:00:00Z",
"updated_at": "2025-05-28T14:05:00Z",
"metadata": {
"tier": "premium"
},
"address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"payment_methods": [
{
"type": "CARD",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"bin": "411111",
"last4": "1111",
"exp_month": 12,
"exp_year": 2028,
"is_network_tokenized": true,
"number": "4111111111111111",
"bin_data": {
"brand": "visa",
"country": "US",
"currency_code": "USD",
"description": "Chase Sapphire Preferred",
"funding": "credit",
"issuer": "Chase Bank",
"type": "consumer"
}
}
},
{
"type": "PAYPAL",
"details": {
"payer_info": {
"email": "alice.johnson@example.com",
"first_name": "Alice",
"last_name": "Johnson",
"payer_id": "PAYER12345",
"tenant": "Tenant"
},
"processor_customer_email": "alice.johnson@example.com",
"processor_customer_id": "cus_pp_1234567890",
"processor_payment_method_id": "pm_pp_1234567890"
}
},
{
"type": "VENMO",
"details": {
"processor_payment_method_id": "pm_venmo_1234567890"
}
},
{
"type": "CASHAPP",
"details": {
"processor_customer_id": "cus_ca_1234567890",
"processor_payment_method_id": "pm_ca_1234567890"
}
},
{
"type": "APPLEPAY",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"token": "ap_token_12345678",
"token_exp_month": 12,
"token_exp_year": 2028,
"token_service_provider": "APPLE"
}
},
{
"type": "GPAY",
"billing_address": {
"city": "San Francisco",
"country": "US",
"line1": "123 Market Street",
"line2": "Suite 400",
"postal_code": "94105",
"state": "CA"
},
"details": {
"token": "gp_token_12345678",
"token_exp_month": 12,
"token_exp_year": 2028,
"token_service_provider": "GOOGLE"
}
}
],
"subscriptions": [
{
"id": "sub_123e4567-e89b-12d3-a456-426614174000",
"status": "active",
"created_at": "2025-05-26T10:00:00Z",
"updated_at": "2025-05-27T10:00:00Z",
"current_period_start": "2025-05-26T10:00:00Z",
"current_period_end": "2025-06-26T10:00:00Z",
"cancelled_at": null,
"cancellation_details": {
"reason": null,
"trigger_payment_id": null
},
"next_billing_date": "2025-06-26T12:00:00Z",
"past_due": {
"attempt_count": 0,
"max_attempts_count": 7
},
"plan": {
"id": "price_1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"name": "Pro Plan",
"type": "recurring",
"interval": "months",
"interval_count": 1,
"trial_interval": "days",
"trial_interval_count": 14,
"price": {
"amount": 1999,
"currency": "USD"
},
"trial_price": {
"amount": 0,
"currency": "USD"
},
"tax": {
"collect_tax": "DEFAULT"
}
},
"metadata": {
"key": "value"
}
}
]
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}{
"error": {
"type": "invalid_request_error",
"message": "Missing required parameter: email",
"code": "parameter_missing",
"param": "email"
}
}