Consultar um cliente
curl --request GET \
--url https://api.valorapayments.com.br/v1/customers/{customer_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.valorapayments.com.br/v1/customers/{customer_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.valorapayments.com.br/v1/customers/{customer_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valorapayments.com.br/v1/customers/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "cus_Xk2v9QeR7tLmN3bA",
"object": "customer",
"name": "<string>",
"email": "<string>",
"document": "<string>",
"phone": "<string>",
"external_reference": "<string>",
"metadata": {
"order_id": "1001"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_api_key",
"message": "Chave de API inválida ou revogada."
}
}{
"error": {
"type": "missing_scope",
"message": "A chave não tem o escopo necessário."
}
}{
"error": {
"type": "not_found",
"message": "Não encontrado."
}
}{
"error": {
"type": "rate_limited",
"message": "Muitas requisições. Tente novamente em instantes."
}
}Clientes
Consultar um cliente
Devolve um cliente.
Escopo: customers:read.
GET
/
v1
/
customers
/
{customer_id}
Consultar um cliente
curl --request GET \
--url https://api.valorapayments.com.br/v1/customers/{customer_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.valorapayments.com.br/v1/customers/{customer_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.valorapayments.com.br/v1/customers/{customer_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.valorapayments.com.br/v1/customers/{customer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "cus_Xk2v9QeR7tLmN3bA",
"object": "customer",
"name": "<string>",
"email": "<string>",
"document": "<string>",
"phone": "<string>",
"external_reference": "<string>",
"metadata": {
"order_id": "1001"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"type": "invalid_api_key",
"message": "Chave de API inválida ou revogada."
}
}{
"error": {
"type": "missing_scope",
"message": "A chave não tem o escopo necessário."
}
}{
"error": {
"type": "not_found",
"message": "Não encontrado."
}
}{
"error": {
"type": "rate_limited",
"message": "Muitas requisições. Tente novamente em instantes."
}
}Autorizações
Resposta
O cliente.