Initiate Cashback Withdrawal
Allows a customer to withdraw their available cashback balance from their cashback account to their bank account. The customer must have sufficient cashback balance to cover the withdrawal amount. The endpoint supports payouts to bank accounts or PayIDs and requires payout method details. Webhook notifications can be configured to receive updates on the withdrawal status.
curl --request POST \
--url https://api.cleverhub.co/api/v2/cashbacks/withdraw \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"user_id": "8GAVZZKTI3",
"client_transaction_id": "withdraw_r15e23",
"cashback_transaction_detail": {
"amount": 1000,
"payout_method_name": "au_bank_npp_aud",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"payment_description": "Withdrawal to bank account",
"currency": "AUD"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_headers": "Bearer your_token"
}
}
'import requests
url = "https://api.cleverhub.co/api/v2/cashbacks/withdraw"
payload = {
"user_id": "8GAVZZKTI3",
"client_transaction_id": "withdraw_r15e23",
"cashback_transaction_detail": {
"amount": 1000,
"payout_method_name": "au_bank_npp_aud",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"payment_description": "Withdrawal to bank account",
"currency": "AUD"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_headers": "Bearer your_token"
}
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
user_id: '8GAVZZKTI3',
client_transaction_id: 'withdraw_r15e23',
cashback_transaction_detail: {
amount: 1000,
payout_method_name: 'au_bank_npp_aud',
payout_method_params: {bsb: '572505', account_number: '76273288'},
payment_description: 'Withdrawal to bank account',
currency: 'AUD'
},
webhook_notification: {
endpoint_url: 'https://merchant.example.com/webhook',
authorization_headers: 'Bearer your_token'
}
})
};
fetch('https://api.cleverhub.co/api/v2/cashbacks/withdraw', 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://api.cleverhub.co/api/v2/cashbacks/withdraw",
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([
'user_id' => '8GAVZZKTI3',
'client_transaction_id' => 'withdraw_r15e23',
'cashback_transaction_detail' => [
'amount' => 1000,
'payout_method_name' => 'au_bank_npp_aud',
'payout_method_params' => [
'bsb' => '572505',
'account_number' => '76273288'
],
'payment_description' => 'Withdrawal to bank account',
'currency' => 'AUD'
],
'webhook_notification' => [
'endpoint_url' => 'https://merchant.example.com/webhook',
'authorization_headers' => 'Bearer your_token'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/cashbacks/withdraw"
payload := strings.NewReader("{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<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))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v2/cashbacks/withdraw")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/cashbacks/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction_type": "money_out",
"withdrawal_id": "HQ2GGUO7",
"client_transaction_id": "r15e23",
"merchant_name": "Hello Clever",
"site_name": "Cashback",
"customer_id": "8GAVZZKTI3",
"amount": 10,
"withdrawal_method": "au_bank_npp_aud",
"status": "processing",
"created_at": "2024-11-07T02:32:42.200Z",
"updated_at": "2024-11-07T02:32:42.231Z",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_header": "Bearer your_token"
}
}Authorizations
A unique identifier assigned to each application.
A secure token associated with the app-id.
Body
The unique identifier of the customer withdrawing cashback.
"8GAVZZKTI3"
A unique identifier for the transaction on the client's side to prevent duplicates.
"withdraw_r15e23"
Contains details for processing the cashback payout.
Show child attributes
Show child attributes
Webhook notification details for callback after processing the payout.
Show child attributes
Show child attributes
Callbacks
POST{$request.body#/webhook_notification/endpoint_url}cashbackWithdrawalCallback
Body
The type of transaction ("money_out").
The unique identifier for the withdrawal transaction.
The client's transaction identifier.
The merchant's name.
The site name.
The customer's unique identifier.
The amount withdrawn.
The method used for withdrawal.
The status of the transaction ("settled" or "failed").
The timestamp when the transaction was created.
The timestamp when the transaction was last updated.
The parameters used for the payout method.
- Option 1
- Option 2
Show child attributes
Show child attributes
Details for webhook notification after the transaction is processed.
Show child attributes
Show child attributes
Response
Callback received successfully.
Response
Withdrawal initiated successfully.
Specifies the type of transaction ("money_out" for withdrawal).
"money_out"
The unique identifier for this withdrawal transaction.
"HQ2GGUO7"
The client's unique transaction identifier.
"r15e23"
The name of the merchant associated with the withdrawal.
"Hello Clever"
The name of the site where the withdrawal is processed.
"Cashback"
The unique identifier of the customer withdrawing cashback.
"8GAVZZKTI3"
The amount of cashback withdrawn, in major units.
10
The method used for the withdrawal (e.g., "au_bank_npp_aud").
"au_bank_npp_aud"
The current status of the transaction (e.g., "processing").
"processing"
The timestamp when the transaction was created.
"2024-11-07T02:32:42.200Z"
The timestamp when the transaction was last updated.
"2024-11-07T02:32:42.231Z"
The parameters used for the payout method.
- Option 1
- Option 2
Show child attributes
Show child attributes
Details for webhook notification after the transaction is processed.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.cleverhub.co/api/v2/cashbacks/withdraw \
--header 'Content-Type: application/json' \
--header 'app-id: <api-key>' \
--header 'secret-key: <api-key>' \
--data '
{
"user_id": "8GAVZZKTI3",
"client_transaction_id": "withdraw_r15e23",
"cashback_transaction_detail": {
"amount": 1000,
"payout_method_name": "au_bank_npp_aud",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"payment_description": "Withdrawal to bank account",
"currency": "AUD"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_headers": "Bearer your_token"
}
}
'import requests
url = "https://api.cleverhub.co/api/v2/cashbacks/withdraw"
payload = {
"user_id": "8GAVZZKTI3",
"client_transaction_id": "withdraw_r15e23",
"cashback_transaction_detail": {
"amount": 1000,
"payout_method_name": "au_bank_npp_aud",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"payment_description": "Withdrawal to bank account",
"currency": "AUD"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_headers": "Bearer your_token"
}
}
headers = {
"app-id": "<api-key>",
"secret-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'app-id': '<api-key>',
'secret-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
user_id: '8GAVZZKTI3',
client_transaction_id: 'withdraw_r15e23',
cashback_transaction_detail: {
amount: 1000,
payout_method_name: 'au_bank_npp_aud',
payout_method_params: {bsb: '572505', account_number: '76273288'},
payment_description: 'Withdrawal to bank account',
currency: 'AUD'
},
webhook_notification: {
endpoint_url: 'https://merchant.example.com/webhook',
authorization_headers: 'Bearer your_token'
}
})
};
fetch('https://api.cleverhub.co/api/v2/cashbacks/withdraw', 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://api.cleverhub.co/api/v2/cashbacks/withdraw",
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([
'user_id' => '8GAVZZKTI3',
'client_transaction_id' => 'withdraw_r15e23',
'cashback_transaction_detail' => [
'amount' => 1000,
'payout_method_name' => 'au_bank_npp_aud',
'payout_method_params' => [
'bsb' => '572505',
'account_number' => '76273288'
],
'payment_description' => 'Withdrawal to bank account',
'currency' => 'AUD'
],
'webhook_notification' => [
'endpoint_url' => 'https://merchant.example.com/webhook',
'authorization_headers' => 'Bearer your_token'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"app-id: <api-key>",
"secret-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cleverhub.co/api/v2/cashbacks/withdraw"
payload := strings.NewReader("{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("app-id", "<api-key>")
req.Header.Add("secret-key", "<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))
}HttpResponse<String> response = Unirest.post("https://api.cleverhub.co/api/v2/cashbacks/withdraw")
.header("app-id", "<api-key>")
.header("secret-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cleverhub.co/api/v2/cashbacks/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["app-id"] = '<api-key>'
request["secret-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n },\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\"\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transaction_type": "money_out",
"withdrawal_id": "HQ2GGUO7",
"client_transaction_id": "r15e23",
"merchant_name": "Hello Clever",
"site_name": "Cashback",
"customer_id": "8GAVZZKTI3",
"amount": 10,
"withdrawal_method": "au_bank_npp_aud",
"status": "processing",
"created_at": "2024-11-07T02:32:42.200Z",
"updated_at": "2024-11-07T02:32:42.231Z",
"payout_method_params": {
"bsb": "572505",
"account_number": "76273288"
},
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_header": "Bearer your_token"
}
}