Flush Account To Account
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/accounts/{account_number}/flush \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"beneficiary": {
"bank_code": "Provide bank code",
"bank_name": "Provide bank name",
"account_number": "Provide account number",
"account_name": "Provide account name"
},
"reference": "Provide transaction reference"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
beneficiary: {
bank_code: 'Provide bank code',
bank_name: 'Provide bank name',
account_number: 'Provide account number',
account_name: 'Provide account name'
},
reference: 'Provide transaction reference'
})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/accounts/{account_number}/flush', 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/accounts/{account_number}/flush",
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([
'beneficiary' => [
'bank_code' => 'Provide bank code',
'bank_name' => 'Provide bank name',
'account_number' => 'Provide account number',
'account_name' => 'Provide account name'
],
'reference' => 'Provide transaction reference'
]),
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/accounts/{account_number}/flush"
payload = {
"beneficiary": {
"bank_code": "Provide bank code",
"bank_name": "Provide bank name",
"account_number": "Provide account number",
"account_name": "Provide account name"
},
"reference": "Provide transaction reference"
}
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/accounts/{account_number}/flush")
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 \"beneficiary\": {\n \"bank_code\": \"Provide bank code\",\n \"bank_name\": \"Provide bank name\",\n \"account_number\": \"Provide account number\",\n \"account_name\": \"Provide account name\"\n },\n \"reference\": \"Provide transaction reference\"\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/accounts/{account_number}/flush"
payload := strings.NewReader("{\n \"beneficiary\": {\n \"bank_code\": \"Provide bank code\",\n \"bank_name\": \"Provide bank name\",\n \"account_number\": \"Provide account number\",\n \"account_name\": \"Provide account name\"\n },\n \"reference\": \"Provide transaction reference\"\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",
"message": "payout was initiated successfully",
"data": {
"amount": 10000,
"total": 10000,
"fee": 0,
"reference": "12323E2445567786989090",
"payment_reference": "206184559544833",
"beneficiary": {
"bank_code": "565",
"bank_name": "CARBON",
"account_number": "2499384072",
"account_name": "CARBON BUSINESS DEMO - TAX"
}
}
}Accounts
Flush Account
Flush the balance of an account to another account.
POST
/
v1
/
accounts
/
{account_number}
/
flush
Flush Account To Account
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/accounts/{account_number}/flush \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"beneficiary": {
"bank_code": "Provide bank code",
"bank_name": "Provide bank name",
"account_number": "Provide account number",
"account_name": "Provide account name"
},
"reference": "Provide transaction reference"
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
beneficiary: {
bank_code: 'Provide bank code',
bank_name: 'Provide bank name',
account_number: 'Provide account number',
account_name: 'Provide account name'
},
reference: 'Provide transaction reference'
})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/accounts/{account_number}/flush', 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/accounts/{account_number}/flush",
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([
'beneficiary' => [
'bank_code' => 'Provide bank code',
'bank_name' => 'Provide bank name',
'account_number' => 'Provide account number',
'account_name' => 'Provide account name'
],
'reference' => 'Provide transaction reference'
]),
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/accounts/{account_number}/flush"
payload = {
"beneficiary": {
"bank_code": "Provide bank code",
"bank_name": "Provide bank name",
"account_number": "Provide account number",
"account_name": "Provide account name"
},
"reference": "Provide transaction reference"
}
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/accounts/{account_number}/flush")
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 \"beneficiary\": {\n \"bank_code\": \"Provide bank code\",\n \"bank_name\": \"Provide bank name\",\n \"account_number\": \"Provide account number\",\n \"account_name\": \"Provide account name\"\n },\n \"reference\": \"Provide transaction reference\"\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/accounts/{account_number}/flush"
payload := strings.NewReader("{\n \"beneficiary\": {\n \"bank_code\": \"Provide bank code\",\n \"bank_name\": \"Provide bank name\",\n \"account_number\": \"Provide account number\",\n \"account_name\": \"Provide account name\"\n },\n \"reference\": \"Provide transaction reference\"\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",
"message": "payout was initiated successfully",
"data": {
"amount": 10000,
"total": 10000,
"fee": 0,
"reference": "12323E2445567786989090",
"payment_reference": "206184559544833",
"beneficiary": {
"bank_code": "565",
"bank_name": "CARBON",
"account_number": "2499384072",
"account_name": "CARBON BUSINESS DEMO - TAX"
}
}
}Overview
This endpoint flushes the balance of an account to another account.Request
Method:POSTURL:
/v1/accounts/{account_number}/flush
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
account_number | Path | integer | Yes | The account number to flush. |
Request Body
{
"beneficiary": {
"bank_code": "565",
"bank_name": "CARBON",
"account_number": "2499384072",
"account_name": "CARBON BUSINESS DEMO - TAX"
},
"reference": "12323E2445567786989090"
}
Response
Status Code:201 CreatedContent-Type:
application/json
Example Response
{
"status": "success",
"message": "Payout was initiated successfully",
"data": {
"amount": 10000,
"total": 10000,
"fee": 0,
"reference": "12323E2445567786989090",
"payment_reference": "206184559544833",
"beneficiary": {
"bank_code": "565",
"bank_name": "CARBON",
"account_number": "2499384072",
"account_name": "CARBON BUSINESS DEMO - TAX"
}
}
}
Authorizations
Provide your API key in the 'apikey' header.
Headers
Path Parameters
Body
application/json
Provide the required values for the request body.
Response
201 - application/json
Created
The response is of type object.
⌘I