Add Guarantor
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/guarantor \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
phone: '08012345678',
email: 'guarantor@example.com'
})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/guarantor', 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/{applicationId}/guarantor",
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([
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '08012345678',
'email' => 'guarantor@example.com'
]),
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/{applicationId}/guarantor"
payload = {
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
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/{applicationId}/guarantor")
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 \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"08012345678\",\n \"email\": \"guarantor@example.com\"\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/{applicationId}/guarantor"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"08012345678\",\n \"email\": \"guarantor@example.com\"\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": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
}Loans
Create Guarantor
Add a guarantor to a loan application.
POST
/
v1
/
loans
/
{applicationId}
/
guarantor
Add Guarantor
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/guarantor \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'John',
last_name: 'Doe',
phone: '08012345678',
email: 'guarantor@example.com'
})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/loans/{applicationId}/guarantor', 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/{applicationId}/guarantor",
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([
'first_name' => 'John',
'last_name' => 'Doe',
'phone' => '08012345678',
'email' => 'guarantor@example.com'
]),
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/{applicationId}/guarantor"
payload = {
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
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/{applicationId}/guarantor")
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 \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"08012345678\",\n \"email\": \"guarantor@example.com\"\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/{applicationId}/guarantor"
payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"phone\": \"08012345678\",\n \"email\": \"guarantor@example.com\"\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": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"phone": "08012345678",
"email": "guarantor@example.com"
}
}Overview
Adds a guarantor to the loan. The guarantor will receive an invitation via theclientPath link to complete their form. This step is optional unless required by the underwriting decision.
Request
Method:POSTURL:
/v1/loans/:applicationId/guarantor
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
applicationId | Path | string | Yes | Application ID. |
Request Body
{
"first_name": "Bola",
"last_name": "Akin",
"phone": "08099887766",
"email": "bola.akin@example.com"
}
| Field | Type | Required | Description |
|---|---|---|---|
first_name | string | Yes | Guarantor’s first name |
last_name | string | Yes | Guarantor’s last name |
phone | string | Yes | Valid Nigerian phone number |
email | string | Yes | Valid email address |
Response
201 Created
{
"status": "success",
"data": {
"id": 7,
"firstName": "Bola",
"lastName": "Akin",
"phoneNumber": "08099887766",
"emailAddress": "bola.akin@example.com",
"clientPath": "https://app.carbon.ng/guarantor",
"loanOfferId": 42,
"tokenExpiresAt": "2025-01-22T10:00:00.000Z",
"inviteSentAt": null,
"submittedAt": null
}
}
| Field | Description |
|---|---|
clientPath | Link sent to the guarantor to complete their form |
tokenExpiresAt | Expiry of the guarantor invite link |
submittedAt | Populated when the guarantor completes the form |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 400 | first_name is required | Field missing |
| 400 | last_name is required | Field missing |
| 400 | phone must be a valid Nigerian number | Invalid or missing phone |
| 400 | email must be a valid email address | Invalid or missing email |
| 400 | Application not found | Invalid applicationId |
| 422 | Application has no loan ID | Application not yet registered |
Authorizations
Provide your API key in the 'apikey' header.
Headers
Path Parameters
Body
application/json
Provide the required values for the request body.
Response
200 - application/json
Successful response
The response is of type object.
⌘I