Enroll Customer
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: '1732ca47-42b2-4990-a65d-c369e934eed3'})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll', 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/loans/customers/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '1732ca47-42b2-4990-a65d-c369e934eed3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/loans/customers/enroll"
payload = { "customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3" }
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"1732ca47-42b2-4990-a65d-c369e934eed3\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll"
payload := strings.NewReader("{\n \"customer_id\": \"1732ca47-42b2-4990-a65d-c369e934eed3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3",
"account_identifier": "PC_abc123xyz456",
"customer_type": "INDIVIDUAL",
"kyc_status": "PENDING",
"enrolled_at": "2024-05-15T10:00:00Z"
}
}Loans
Enroll Customer
Enroll an existing customer for lending. Idempotent — returns the existing enrollment if already enrolled.
POST
/
v1
/
loans
/
customers
/
enroll
Enroll Customer
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: '1732ca47-42b2-4990-a65d-c369e934eed3'})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll', 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/loans/customers/enroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '1732ca47-42b2-4990-a65d-c369e934eed3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/loans/customers/enroll"
payload = { "customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3" }
headers = {
"x-carbon-key": "<x-carbon-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-carbon-key"] = '<x-carbon-key>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"1732ca47-42b2-4990-a65d-c369e934eed3\"\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/customers/enroll"
payload := strings.NewReader("{\n \"customer_id\": \"1732ca47-42b2-4990-a65d-c369e934eed3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-carbon-key", "<x-carbon-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "success",
"data": {
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3",
"account_identifier": "PC_abc123xyz456",
"customer_type": "INDIVIDUAL",
"kyc_status": "PENDING",
"enrolled_at": "2024-05-15T10:00:00Z"
}
}Overview
Registers an existing customer with the Carbon lending engine. The customer must already exist (created viaPOST /v1/customers) and must have a BVN and an active wallet account.
This call is idempotent — sending the same customer_id twice returns the existing enrollment with 200 OK instead of creating a duplicate.
Request
Method:POSTURL:
/v1/loans/customers/enroll
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
Request Body
{
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3"
}
| Field | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | UUID of the customer from POST /v1/customers |
Response
201 — New Enrollment
{
"status": "success",
"message": "Customer enrolled for lending",
"data": {
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3",
"customer_type": "INDIVIDUAL",
"kyc_status": "PENDING",
"enrolled_at": "2025-01-15T10:05:00.000Z"
}
}
200 — Already Enrolled
{
"status": "success",
"message": "Customer already enrolled",
"data": {
"customer_id": "1732ca47-42b2-4990-a65d-c369e934eed3",
"account_identifier": "PC_abc123xyz456def78901",
"customer_type": "INDIVIDUAL",
"kyc_status": "PENDING"
}
}
| Field | Type | Description |
|---|---|---|
customer_id | string | The customer UUID |
account_identifier | string | Lending engine identifier. Present only on repeat calls. |
customer_type | string | INDIVIDUAL or BUSINESS |
kyc_status | string | Initial status is always PENDING |
enrolled_at | string | UTC ISO-8601 timestamp |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | customer_id is required | Field missing from request body |
| 400 | Customer not found | customer_id not found under this merchant |
| 422 | Customer must have a BVN to enroll for lending | Customer record has no BVN |
| 422 | Customer must have an account before enrolling for lending | Customer has no active wallet/account |
Authorizations
Provide your API key in the 'apikey' header.
Headers
Body
application/json
Provide the required values for the request body.
UUID of the customer to enroll
Example:
"1732ca47-42b2-4990-a65d-c369e934eed3"
Response
200 - application/json
Successful response
The response is of type object.
⌘I