curl --request POST \
--url https://api-dashboard.payra.com/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123"
}
'import requests
url = "https://api-dashboard.payra.com/v1/customers/{id}"
payload = {
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123"
}
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: 'Ada Lovelace', email: '[email protected]', phone: '+15555550123'})
};
fetch('https://api-dashboard.payra.com/v1/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-dashboard.payra.com/v1/customers/{id}",
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' => 'Ada Lovelace',
'email' => '[email protected]',
'phone' => '+15555550123'
]),
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-dashboard.payra.com/v1/customers/{id}"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\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-dashboard.payra.com/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/customers/{id}")
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\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\n}"
response = http.request(request)
puts response.read_body{
"object": "customer",
"id": "019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30",
"reference": "user_48213",
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123",
"created_at": "2026-09-29T14:00:00.000Z"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Update a customer
Changes the name, the email or the phone; fields left out are kept, and null clears one. The change shows in the Payra dashboard at once, and a new email is where receipts go and who can sign in to the customer portal from then on. reference cannot be changed. Not available on a workspace whose customers come from an ERP integration.
curl --request POST \
--url https://api-dashboard.payra.com/v1/customers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123"
}
'import requests
url = "https://api-dashboard.payra.com/v1/customers/{id}"
payload = {
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123"
}
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: 'Ada Lovelace', email: '[email protected]', phone: '+15555550123'})
};
fetch('https://api-dashboard.payra.com/v1/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-dashboard.payra.com/v1/customers/{id}",
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' => 'Ada Lovelace',
'email' => '[email protected]',
'phone' => '+15555550123'
]),
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-dashboard.payra.com/v1/customers/{id}"
payload := strings.NewReader("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\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-dashboard.payra.com/v1/customers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/customers/{id}")
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\": \"Ada Lovelace\",\n \"email\": \"[email protected]\",\n \"phone\": \"+15555550123\"\n}"
response = http.request(request)
puts response.read_body{
"object": "customer",
"id": "019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30",
"reference": "user_48213",
"name": "Ada Lovelace",
"email": "[email protected]",
"phone": "+15555550123",
"created_at": "2026-09-29T14:00:00.000Z"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
A secret key, sk_test_... or sk_live_...; a publishable key (pk_...) on the browser routes only
Path Parameters
1 - 64Body
The name shown in the Payra dashboard. null shows the email instead, or the reference.
1 - 200"Ada Lovelace"
Where Payra sends this customer's payment receipts, and the address that signs in to the customer portal. null removes it. Other addresses your team added in the dashboard are kept either way.
254E.164; null removes it.
^\+[1-9]\d{9,14}$"+15555550123"
Response
The customer
customer Pass it as customer on a payment method session, a checkout session or a payment.
"019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30"
Your own id for the customer; null for customers created in the Payra dashboard or by an ERP.
"user_48213"
The name shown in the Payra dashboard: the email, or the reference, when created without one.
"Ada Lovelace"
"+15555550123"
"2026-09-29T14:00:00.000Z"