PATCH
/api/v2/customers/{customer}
Requires authentication
v2
Send a bearer token in the Authorization header.
Partial update — omitted fields are left untouched.
Full URL: https://api.acme.example/api/v2/customers/{customer}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| customer | integer | yes | The customer id. |
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string, maxLength 255 | no | |
| status | string, one of active, archived | no | Archiving hides the customer from list endpoints. |
Responses
200 The updated customer.
| Field | Type | Description |
|---|---|---|
| id | integer | |
| string<email> | ||
| name | string | |
| status | string, one of active, invited, archived | |
| created_at | string<date-time> |
422 Validation failed.
Example request
curl -X PATCH 'https://api.acme.example/api/v2/customers/1' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Jane Doe",
"status": "active"
}'
const response = await fetch('https://api.acme.example/api/v2/customers/1', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Jane Doe",
"status": "active"
})
});
const data = await response.json();
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->patch('https://api.acme.example/api/v2/customers/1', [
'name' => 'Jane Doe',
'status' => 'active',
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('PATCH', 'https://api.acme.example/api/v2/customers/1', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Jane Doe',
'status' => 'active',
],
]);
$data = json_decode((string) $response->getBody(), true);