Get a customer by ID
curl --request GET \
--url https://api.example.com/customers/{customerId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/customers/{customerId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/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.example.com/customers/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/customers/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/customers/{customerId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "590ce6c56d04f840aa8438af",
"organizationId": "org-uuid",
"legalName": "Dunder Mifflin",
"taxId": "ABC101010111",
"taxSystem": "601",
"email": "email@example.com",
"defaultInvoiceUse": "G01",
"address": {
"street": "Blvd. Atardecer",
"exterior": "142",
"neighborhood": "Centro",
"city": "Huatabampo",
"municipality": "Huatabampo",
"zip": "86500",
"state": "Sonora",
"country": "MEX",
"interior": "4"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"phone": "6474010101"
}Customers
Get Customer
GET
/
customers
/
{customerId}
Get a customer by ID
curl --request GET \
--url https://api.example.com/customers/{customerId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.example.com/customers/{customerId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.example.com/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.example.com/customers/{customerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/customers/{customerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/customers/{customerId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/customers/{customerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "590ce6c56d04f840aa8438af",
"organizationId": "org-uuid",
"legalName": "Dunder Mifflin",
"taxId": "ABC101010111",
"taxSystem": "601",
"email": "email@example.com",
"defaultInvoiceUse": "G01",
"address": {
"street": "Blvd. Atardecer",
"exterior": "142",
"neighborhood": "Centro",
"city": "Huatabampo",
"municipality": "Huatabampo",
"zip": "86500",
"state": "Sonora",
"country": "MEX",
"interior": "4"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"phone": "6474010101"
}Returns a single customer by ID.
This endpoint takes noorganizationIdin the URL. Authenticate with either a Supabase Bearer session (send theX-Organization-Id: <org-id>header — the user must be a member of that organization) or an API key (the organization resolves automatically from the key; anyX-Organization-Idheader sent alongside an API key is ignored).
Authentication
Accepts either:- A Supabase Bearer session (
Authorization: Bearer <token>) with theX-Organization-Id: <org-id>header — the authenticated user must be a member of that organization. - An API key (
X-API-Key: sk_...) with theread:customersscope — the organization is resolved from the key itself.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | Customer ID |
Example Request
curl -X GET https://api.timbrix.mx/customers/590ce6c56d04f840aa8438af \
-H "Authorization: Bearer <your_token>" \
-H "X-Organization-Id: 550e8400-e29b-41d4-a716-446655440000"
import { Timbrix } from "@timbrix/sdk"
const client = new Timbrix({ bearerToken: "<your_token>" })
const customer = await client.customers.get(
"590ce6c56d04f840aa8438af",
"550e8400-e29b-41d4-a716-446655440000"
)
console.log(customer)
Example Response
{
"id": "590ce6c56d04f840aa8438af",
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"legalName": "Dunder Mifflin",
"taxId": "DUM901231AB3",
"taxSystem": "601",
"email": "billing@dundermifflin.com",
"phone": "6474010101",
"defaultInvoiceUse": "G01",
"address": {
"street": "Blvd. Atardecer",
"exterior": "142",
"interior": null,
"neighborhood": "Centro",
"city": "Huatabampo",
"municipality": "Huatabampo",
"zip": "86500",
"state": "Sonora",
"country": "MEX"
},
"createdAt": "2025-01-26T10:00:00Z",
"updatedAt": "2025-01-26T10:00:00Z"
}
Common Errors
400 Bad Request
MissingX-Organization-Id header on a session-authenticated request.
401 Unauthorized
Missing or invalid Bearer token / API key.403 Forbidden
The authenticated user is not a member of the organization sent inX-Organization-Id, or the API key does not have the read:customers scope.
404 Not Found
Customer not found.Authorizations
apiKeybearer
API Key for authentication (format: sk_...)
Headers
Required for Supabase session auth. Ignored when authenticating with an API key (the organization resolves from the key).
Path Parameters
Response
Example:
"590ce6c56d04f840aa8438af"
Example:
"org-uuid"
Example:
"Dunder Mifflin"
Example:
"ABC101010111"
Example:
"601"
Example:
"email@example.com"
Example:
"G01"
Show child attributes
Show child attributes
Example:
"6474010101"