Approve or Decline Payout
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/payouts/approvals/approve \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"authCode": "TRF-1771341301552SNKED",
"action": "approve",
"reason": ""
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({authCode: 'TRF-1771341301552SNKED', action: 'approve', reason: ''})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/payouts/approvals/approve', 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/payouts/approvals/approve",
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([
'authCode' => 'TRF-1771341301552SNKED',
'action' => 'approve',
'reason' => ''
]),
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/payouts/approvals/approve"
payload = {
"authCode": "TRF-1771341301552SNKED",
"action": "approve",
"reason": ""
}
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/payouts/approvals/approve")
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 \"authCode\": \"TRF-1771341301552SNKED\",\n \"action\": \"approve\",\n \"reason\": \"\"\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/payouts/approvals/approve"
payload := strings.NewReader("{\n \"authCode\": \"TRF-1771341301552SNKED\",\n \"action\": \"approve\",\n \"reason\": \"\"\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 approved successfully"
}{
"status": "failed",
"message": "invalid authorization code"
}{
"status": "failed",
"message": "reason is required when declining a payout"
}Payouts
Approve or Decline Payout
Approve or decline a pending payout request using its authorization code.
POST
/
v1
/
payouts
/
approvals
/
approve
Approve or Decline Payout
curl --request POST \
--url https://carbonapistagingsecure.getcarbon.co/baas/api/v1/payouts/approvals/approve \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'x-carbon-key: <x-carbon-key>' \
--data '
{
"authCode": "TRF-1771341301552SNKED",
"action": "approve",
"reason": ""
}
'const options = {
method: 'POST',
headers: {
'x-carbon-key': '<x-carbon-key>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({authCode: 'TRF-1771341301552SNKED', action: 'approve', reason: ''})
};
fetch('https://carbonapistagingsecure.getcarbon.co/baas/api/v1/payouts/approvals/approve', 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/payouts/approvals/approve",
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([
'authCode' => 'TRF-1771341301552SNKED',
'action' => 'approve',
'reason' => ''
]),
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/payouts/approvals/approve"
payload = {
"authCode": "TRF-1771341301552SNKED",
"action": "approve",
"reason": ""
}
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/payouts/approvals/approve")
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 \"authCode\": \"TRF-1771341301552SNKED\",\n \"action\": \"approve\",\n \"reason\": \"\"\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/payouts/approvals/approve"
payload := strings.NewReader("{\n \"authCode\": \"TRF-1771341301552SNKED\",\n \"action\": \"approve\",\n \"reason\": \"\"\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 approved successfully"
}{
"status": "failed",
"message": "invalid authorization code"
}{
"status": "failed",
"message": "reason is required when declining a payout"
}Overview
This endpoint allows you to approve or decline a pending payout request. You must provide theauthCode from the pending approval record along with the desired action. A reason is required when declining.
Request
Method:POST
URL: /v1/payouts/approvals/approve
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
x-carbon-key | Header | string | Yes | API key for authentication. |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
authCode | string | Yes | Authorization code of the pending payout (e.g. TRF-...). |
action | string | Yes | Action to take: approve or decline. |
reason | string | Required if action is decline | Reason for declining the payout. |
{
"authCode": "TRF-1771341301552SNKED",
"action": "approve",
"reason": ""
}
When
action is decline, the reason field is required. For approve, it can be left as an empty string or omitted.Response
Status Code:200 OK
Content-Type: application/json
Example Response (Approved)
{
"status": "success",
"message": "Payout approved successfully"
}
Example Response (Declined)
{
"status": "success",
"message": "Payout declined successfully"
}
Error Responses
Status Code:400 Bad Request
{
"status": "failed",
"message": "invalid authorization code"
}
422 Unprocessable Entity
Returned when action is decline but reason is missing.
{
"status": "failed",
"message": "reason is required when declining a payout"
}
Authorizations
Provide your API key in the 'apikey' header.
Headers
Body
application/json
Provide the required values for the request body.
Response
OK
The response is of type object.