Get a customer
curl --request GET \
--url https://api-sandbox.beinfi.com/customers/{customerID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.beinfi.com/customers/{customerID}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.beinfi.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-sandbox.beinfi.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 => [
"Authorization: Bearer <token>"
],
]);
$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-sandbox.beinfi.com/customers/{customerID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.beinfi.com/customers/{customerID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/customers/{customerID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"email": "<string>",
"taxId": "<string>",
"phone": "<string>",
"pspRef": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"enrollments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"email": "<string>",
"taxId": "<string>",
"pspRef": "<string>",
"metadata": {},
"creditAlertSent": true,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}Customers
Get a customer
Given a customer ID, returns the customer and all their enrollments (CustomerDetail). Given an enrollment ID, returns just that enrollment (ProductCustomer).
GET
/
customers
/
{customerID}
Get a customer
curl --request GET \
--url https://api-sandbox.beinfi.com/customers/{customerID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.beinfi.com/customers/{customerID}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.beinfi.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-sandbox.beinfi.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 => [
"Authorization: Bearer <token>"
],
]);
$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-sandbox.beinfi.com/customers/{customerID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.beinfi.com/customers/{customerID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.beinfi.com/customers/{customerID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"email": "<string>",
"taxId": "<string>",
"phone": "<string>",
"pspRef": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"enrollments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"name": "<string>",
"email": "<string>",
"taxId": "<string>",
"pspRef": "<string>",
"metadata": {},
"creditAlertSent": true,
"createdAt": "2023-11-07T05:31:56Z"
}
]
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>"
}{
"message": "<string>",
"error_code": "internal_error",
"tracer_id": "<string>",
"resource": "<string>"
}Authorizations
Your account's secret key: Authorization: Bearer sk_test_… or sk_live_…. Server-side only.
Path Parameters
Customer ID.
Response
The customer or the enrollment.
- Option 1
- Option 2
The customer and all their enrollments.
Customer ID. Not the enrollment ID.
This customer's id in your own system.
CPF or CNPJ.
Contact phone, in international format as digits only, without + (for example 5511999999999). Used for contact; it does not identify the customer.
The customer's reference with the payment processor, when there is one.
Show child attributes
Show child attributes