Skip to main content

Initiate Cashback Withdrawal

POST 

https://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

Bodyrequired

    user_idstringrequired

    The unique identifier of the customer withdrawing cashback.

    Example: 8GAVZZKTI3
    client_transaction_idstringrequired

    A unique identifier for the transaction on the client's side to prevent duplicates.

    Example: withdraw_r15e23
    cashback_transaction_detail objectrequired

    Contains details for processing the cashback payout.

    payment_descriptionstring

    A description for the withdrawal transaction.

    Example: Withdrawal to bank account
    currencystring

    The currency code for the payout, following ISO 4217 standards. Default is "AUD".

    Example: AUD
    amountintegerrequired

    The amount of cashback to be paid out, in minor units (e.g., 1000 for $10.00).

    Example: 1000
    payout_method_namestringrequired

    The payout method used. Currently supports "au_bank_npp_aud" for bank transfers or "au_payid_npp_aud" for PayID transfers.

    Possible values: [au_bank_npp_aud, au_payid_npp_aud]

    Example: au_bank_npp_aud
    payout_method_params objectrequired

    Parameters required for the selected payout method.

    oneOf
    webhook_notification objectrequired

    Webhook notification details for callback after processing the payout.

    endpoint_urlurirequired

    The URL where the webhook notification will be sent.

    Example: https://merchant.example.com/webhook
    authorization_headersstringrequired

    Authorization headers for securing the webhook notification.

    Example: Bearer your_token

Responses

Withdrawal initiated successfully.

Schema
    transaction_typestring

    Specifies the type of transaction ("money_out" for withdrawal).

    Example: money_out
    withdrawal_idstring

    The unique identifier for this withdrawal transaction.

    Example: HQ2GGUO7
    client_transaction_idstring

    The client's unique transaction identifier.

    Example: r15e23
    merchant_namestring

    The name of the merchant associated with the withdrawal.

    Example: Hello Clever
    site_namestring

    The name of the site where the withdrawal is processed.

    Example: Cashback
    customer_idstring

    The unique identifier of the customer withdrawing cashback.

    Example: 8GAVZZKTI3
    amountfloat

    The amount of cashback withdrawn, in major units.

    Example: 10
    withdrawal_methodstring

    The method used for the withdrawal (e.g., "au_bank_npp_aud").

    Example: au_bank_npp_aud
    statusstring

    The current status of the transaction (e.g., "processing").

    Example: processing
    created_atdate-time

    The timestamp when the transaction was created.

    Example: 2024-11-07T02:32:42.200Z
    updated_atdate-time

    The timestamp when the transaction was last updated.

    Example: 2024-11-07T02:32:42.231Z
    payout_method_params object

    The parameters used for the payout method.

    oneOf
    webhook_notification object

    Details for webhook notification after the transaction is processed.

    endpoint_urluri

    The URL where the webhook notification will be sent.

    Example: https://merchant.example.com/webhook
    authorization_headerstring

    The authorization header used in the webhook notification.

    Example: Bearer your_token

Callbacks

POST 

{$request.body#/webhook_notification/endpoint_url}

Bodyrequired

    transaction_typestring

    The type of transaction ("money_out").

    withdrawal_idstring

    The unique identifier for the withdrawal transaction.

    client_transaction_idstring

    The client's transaction identifier.

    merchant_namestring

    The merchant's name.

    site_namestring

    The site name.

    customer_idstring

    The customer's unique identifier.

    amountfloat

    The amount withdrawn.

    withdrawal_methodstring

    The method used for withdrawal.

    statusstring

    The status of the transaction ("settled" or "failed").

    created_atdate-time

    The timestamp when the transaction was created.

    updated_atdate-time

    The timestamp when the transaction was last updated.

    payout_method_params object

    The parameters used for the payout method.

    oneOf
    webhook_notification object

    Details for webhook notification after the transaction is processed.

    endpoint_urluri

    The webhook endpoint URL.

    authorization_headerstring

    The authorization header for the webhook.

Callbacks Responses

Callback received successfully.

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`.
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());
Request Collapse all
Base URL
https://api.cleverhub.co/api
Auth
Body required
{
  "user_id": "8GAVZZKTI3",
  "client_transaction_id": "withdraw_r15e23",
  "cashback_transaction_detail": {
    "payment_description": "Withdrawal to bank account",
    "currency": "AUD",
    "amount": 1000,
    "payout_method_name": "au_bank_npp_aud",
    "payout_method_params": {
      "bsb": "572505",
      "account_number": "76273288"
    }
  },
  "webhook_notification": {
    "endpoint_url": "https://merchant.example.com/webhook",
    "authorization_headers": "Bearer your_token"
  }
}
ResponseClear

Click the Send API Request button above and see the response here!