Initiate Cashback Withdrawal
POSThttps://api.cleverhub.co/api/v2/cashbacks/withdraw
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.
Request
- application/json
Bodyrequired
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
cashback_transaction_detail objectrequired
webhook_notification objectrequired
Responses
- 200
- 400
- 401
Withdrawal initiated successfully.
- application/json
- Schema
- Example (auto)
Schema
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
payout_method_params object
webhook_notification object
{
"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"
}
}
Bad Request
Unauthorized
Callbacks
- POST cashbackWithdrawalCallback
POST{$request.body#/webhook_notification/endpoint_url}
- application/json
Bodyrequired
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.
payout_method_params object
webhook_notification object
Callbacks Responses
- 200
- 400
- 401
Callback received successfully.
Bad Request
Unauthorized
Authorization: app-id
name: app-idtype: apiKeyin: headerdescription: A unique identifier assigned to each application.
name: secret-keytype: apiKeyin: headerdescription: A secure token associated with the `app-id`.
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v2/cashbacks/withdraw");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("app-id", "<app-id>");
request.Headers.Add("secret-key", "<app-id>");
var content = new StringContent("{\n \"user_id\": \"8GAVZZKTI3\",\n \"client_transaction_id\": \"withdraw_r15e23\",\n \"cashback_transaction_detail\": {\n \"payment_description\": \"Withdrawal to bank account\",\n \"currency\": \"AUD\",\n \"amount\": 1000,\n \"payout_method_name\": \"au_bank_npp_aud\",\n \"payout_method_params\": {\n \"bsb\": \"572505\",\n \"account_number\": \"76273288\"\n }\n },\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.example.com/webhook\",\n \"authorization_headers\": \"Bearer your_token\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());