Update a customer
curl --request PATCH \
--url https://api.globalstack.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"metadata": {},
"profile": {
"phone": "<string>",
"address": "<string>",
"date_of_birth": "<string>",
"id_number": "<string>",
"id_type": "<string>",
"business_licence": "<string>"
}
}
'import requests
url = "https://api.globalstack.io/v1/customers/{customerId}"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"metadata": {},
"profile": {
"phone": "<string>",
"address": "<string>",
"date_of_birth": "<string>",
"id_number": "<string>",
"id_type": "<string>",
"business_licence": "<string>"
}
}
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({
name: '<string>',
email: 'jsmith@example.com',
metadata: {},
profile: {
phone: '<string>',
address: '<string>',
date_of_birth: '<string>',
id_number: '<string>',
id_type: '<string>',
business_licence: '<string>'
}
})
};
fetch('https://api.globalstack.io/v1/customers/{customerId}', 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.globalstack.io/v1/customers/{customerId}",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'metadata' => [
],
'profile' => [
'phone' => '<string>',
'address' => '<string>',
'date_of_birth' => '<string>',
'id_number' => '<string>',
'id_type' => '<string>',
'business_licence' => '<string>'
]
]),
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.globalstack.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\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.globalstack.io/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalstack.io/v1/customers/{customerId}")
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 \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Customer updated successfully",
"code": "ok",
"data": {
"id": "cust_01HXYZABC1234567890ABCDEFG",
"type": "individual",
"name": "Alice Johnson",
"email": "alice@example.com",
"merchant_reference": "ref_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"country_code": "NG",
"tier": "tier_0",
"kyc_status": "not_started",
"metadata": {
"source": "checkout"
},
"created_at": "2026-04-16T16:14:08.000Z",
"updated_at": "2026-04-16T16:14:08.000Z",
"profile": {
"phone": "+2348012345678",
"address": "1 Marina Rd, Lagos",
"date_of_birth": "01/15/1990",
"id_number": "A12345678",
"id_type": "passport",
"business_licence": "RC123456"
}
},
"meta": {
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}Customers
Update a customer
Update a customer. Send only the fields you’re changing. An empty body returns the customer unchanged.
Body
| Field | Behaviour |
|---|---|
name | Max 255 chars. Individuals still need a first and last name. |
email | Max 255 chars. Must be unique in your integration, ignoring case, or you get 409 duplicate_resource. |
metadata | Replaces the whole map. Keys you leave out are removed. |
profile | Merges field by field. Only the keys you send change. Keys: phone, address, id_number, id_type, business_licence, and date_of_birth (mm/dd/yyyy). |
You can’t clear a profile or metadata key: leave it out to keep it, or send a new value.
type, country_code and merchant_reference are fixed at creation. Sending them returns
400 bad_request.
Example
Add a phone number, for example before opening a GHS virtual account:
PATCH /v1/customers/cust_01HXYZABC1234567890ABCDEFG
{ "profile": { "phone": "+233201234567" } }
PATCH
/
v1
/
customers
/
{customerId}
Update a customer
curl --request PATCH \
--url https://api.globalstack.io/v1/customers/{customerId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"metadata": {},
"profile": {
"phone": "<string>",
"address": "<string>",
"date_of_birth": "<string>",
"id_number": "<string>",
"id_type": "<string>",
"business_licence": "<string>"
}
}
'import requests
url = "https://api.globalstack.io/v1/customers/{customerId}"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"metadata": {},
"profile": {
"phone": "<string>",
"address": "<string>",
"date_of_birth": "<string>",
"id_number": "<string>",
"id_type": "<string>",
"business_licence": "<string>"
}
}
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({
name: '<string>',
email: 'jsmith@example.com',
metadata: {},
profile: {
phone: '<string>',
address: '<string>',
date_of_birth: '<string>',
id_number: '<string>',
id_type: '<string>',
business_licence: '<string>'
}
})
};
fetch('https://api.globalstack.io/v1/customers/{customerId}', 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.globalstack.io/v1/customers/{customerId}",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'metadata' => [
],
'profile' => [
'phone' => '<string>',
'address' => '<string>',
'date_of_birth' => '<string>',
'id_number' => '<string>',
'id_type' => '<string>',
'business_licence' => '<string>'
]
]),
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.globalstack.io/v1/customers/{customerId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\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.globalstack.io/v1/customers/{customerId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.globalstack.io/v1/customers/{customerId}")
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 \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"metadata\": {},\n \"profile\": {\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"date_of_birth\": \"<string>\",\n \"id_number\": \"<string>\",\n \"id_type\": \"<string>\",\n \"business_licence\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Customer updated successfully",
"code": "ok",
"data": {
"id": "cust_01HXYZABC1234567890ABCDEFG",
"type": "individual",
"name": "Alice Johnson",
"email": "alice@example.com",
"merchant_reference": "ref_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"country_code": "NG",
"tier": "tier_0",
"kyc_status": "not_started",
"metadata": {
"source": "checkout"
},
"created_at": "2026-04-16T16:14:08.000Z",
"updated_at": "2026-04-16T16:14:08.000Z",
"profile": {
"phone": "+2348012345678",
"address": "1 Marina Rd, Lagos",
"date_of_birth": "01/15/1990",
"id_number": "A12345678",
"id_type": "passport",
"business_licence": "RC123456"
}
},
"meta": {
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}{
"status": false,
"message": "Resource not found",
"code": "not_found",
"data": null,
"meta": {
"next_steps": {
"action": "Verify the resource identifier and retry.",
"docs_url": "https://docs.globalstack.io/errors#not_found"
},
"request_id": "req_01HXYZ4K5ABCDEFGHJKLMNPQRS",
"timestamp": "2026-05-14T15:43:55.732Z",
"version": "1"
}
}Body
application/json
UpdateCustomerDto
Response
Customer updated successfully