Fetch Customer
curl --request GET \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id} \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>'const options = {
method: 'GET',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}', 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://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{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 => [
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}"
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "Customer fetched successfully",
"data": {
"id": "965c4bf7-e86b-45ca-b286-1ee6f32e991b",
"first_name": "ola",
"last_name": "ajayi",
"email": "ola@yahoo.com",
"phone": "08071000030",
"nin": "11111111111",
"bvn": "11111111111",
"is_business": false,
"business_name": null,
"mode": "sandbox",
"created_at": "2024-02-27T16:15:38.000Z",
"updated_at": "2024-02-27T16:15:38.000Z"
}
}Customers
Fetch Customer
Retrieve details of a specific customer by ID.
GET
/
v1
/
customers
/
{id}
Fetch Customer
curl --request GET \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id} \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>'const options = {
method: 'GET',
headers: {'x-carbon-key': '<x-carbon-key>', apikey: '<api-key>'}
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}', 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://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{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 => [
"apikey: <api-key>",
"x-carbon-key: <x-carbon-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}"
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/customers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"message": "Customer fetched successfully",
"data": {
"id": "965c4bf7-e86b-45ca-b286-1ee6f32e991b",
"first_name": "ola",
"last_name": "ajayi",
"email": "ola@yahoo.com",
"phone": "08071000030",
"nin": "11111111111",
"bvn": "11111111111",
"is_business": false,
"business_name": null,
"mode": "sandbox",
"created_at": "2024-02-27T16:15:38.000Z",
"updated_at": "2024-02-27T16:15:38.000Z"
}
}Overview
This endpoint retrieves the details of a specific customer identified by their ID.Request
Method:GETURL:
/v1/customers/{id}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
id | Path | string | Yes | The unique identifier of the customer. |
Response
Status Code:200 OKContent-Type:
application/json
Example Response
{
"status": "success",
"message": "Customer fetched successfully",
"data": {
"id": "965c4bf7-e86b-45ca-b286-1ee6f32e991b",
"first_name": "Ola",
"last_name": "Ajayi",
"email": "ola@yahoo.com",
"phone": "08071000030",
"nin": "11111111111",
"bvn": "11111111111",
"is_business": false,
"business_name": null,
"mode": "sandbox",
"created_at": "2024-02-27T16:15:38.000Z",
"updated_at": "2024-02-27T16:15:38.000Z"
}
}
⌘I