Skip to main content

Initiate Cashback Delivery

POST 

https://api.cleverhub.co/api/v2/cashbacks/deliver

Calculates and delivers cashback to a user participating in a cashback campaign. Funds will be deducted from the merchant's balance to transfer to the user, so it is essential to ensure sufficient balance before initiating the cashback delivery. This endpoint requires details such as the user's ID, purchase amount, and campaign ID, along with payment method and transaction identifiers.

Request

Bodyrequired

    user_idstringrequired

    The unique identifier of the user receiving the cashback.

    Example: 8GAVZZKTI3
    payment_methodstringrequired

    The payment method used in the transaction (e.g., "pay_id").

    Example: pay_id
    client_transaction_idstringrequired

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

    Example: delivery_8263e133e2
    purchase_amountintegerrequired

    The total amount of the purchase for which cashback is applicable, in minor units (e.g., 500 for $5.00).

    Example: 500
    transaction_datedate

    The date of the transaction in "YYYY-MM-DD" format.

    Example: 2024-10-09
    transaction_timetime

    The time of the transaction in "HH:mm:ss" format.

    Example: 00:00:11
    campaign_idstringrequired

    The unique identifier (UUID) of the cashback campaign associated with this transaction.

    Example: LOQVYIM0
    currencystringrequired

    The currency code of the transaction, following ISO 4217 standards (e.g., "aud" for Australian Dollar). Default is "aud".

    Example: aud
    webhook_notification objectrequired

    Details for sending a webhook notification after processing the transaction.

    endpoint_urlurirequired

    The URL to which the webhook will be sent.

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

    Authorization headers for securing the webhook notification.

    Example: Bearer your_token

Responses

Cashback delivered successfully.

Schema
    idstring

    The unique identifier for this cashback transaction in Hello Clever's system.

    Example: JTDOL51K
    client_transaction_idstring

    The client's unique transaction identifier.

    Example: 8263e133e2
    transaction_typestring

    The type of transaction, indicating the flow of money (e.g., "money_in" for cashback deposits).

    Example: money_in
    balance_idstring

    The unique identifier for the balance transaction in Hello Clever's dashboard linked to this transaction.

    Example: B283A882-18A4C85E
    campaign_idstring

    The unique identifier of the cashback campaign.

    Example: NBAOZMPR
    site_idstring

    The unique identifier of the site where the transaction occurred.

    Example: 3BAVFJ6H
    purchase_amountfloat

    The total amount of the purchase for which cashback applies, in major units (e.g., 500.0 for $500.00).

    Example: 500
    payment_methodstring

    The payment method used in the transaction.

    Example: pay_id
    customer_idstring

    The unique identifier of the customer receiving the cashback.

    Example: 8GAVZZKTI3
    cashback_amountfloat

    The amount of cashback awarded in the transaction, in major units.

    Example: 25
    statusstring

    The status of the cashback transaction. Possible values are "created", "processing", "settled", or "failed".

    Example: settled
    created_atdate-time

    The timestamp when the transaction was created.

    Example: 2024-11-06T16:49:44.402Z
    updated_atdate-time

    The timestamp when the transaction was last updated.

    Example: 2024-11-06T16:49:44.402Z
    transaction_datedate

    The date of the transaction as provided by the client.

    Example: 2024-10-09
    transaction_timetime

    The time of the transaction as provided by the client.

    Example: 00:00:11
    webhook_notification object

    Configuration for sending webhook notifications.

    endpoint_urluri

    The URL where the webhook will be sent.

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

    Authorization headers for the webhook.

    Example: Bearer your_token

Callbacks

POST 

{$request.body#/webhook_notification/endpoint_url}

Bodyrequired

    idstring

    The unique identifier for the cashback transaction.

    client_transaction_idstring

    The client's unique transaction identifier.

    transaction_typestring

    The type of transaction ("money_in").

    balance_idstring

    The unique identifier for the balance transaction.

    campaign_idstring

    The unique identifier of the cashback campaign.

    site_idstring

    The unique identifier of the site.

    purchase_amountfloat

    The purchase amount.

    payment_methodstring

    The payment method used.

    customer_idstring

    The customer's unique identifier.

    cashback_amountfloat

    The cashback amount awarded.

    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.

    transaction_datedate

    The date of the transaction.

    transaction_timetime

    The time of the transaction.

    webhook_notification object

    Configuration for the webhook notification.

    endpoint_urluri

    The webhook endpoint URL.

    authorization_headersstring

    The authorization headers 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/deliver");
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 \"payment_method\": \"pay_id\",\n \"client_transaction_id\": \"delivery_8263e133e2\",\n \"purchase_amount\": 500,\n \"transaction_date\": \"2024-10-09\",\n \"transaction_time\": \"00:00:11\",\n \"campaign_id\": \"LOQVYIM0\",\n \"currency\": \"aud\",\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",
  "payment_method": "pay_id",
  "client_transaction_id": "delivery_8263e133e2",
  "purchase_amount": 500,
  "transaction_date": "2024-10-09",
  "transaction_time": "00:00:11",
  "campaign_id": "LOQVYIM0",
  "currency": "aud",
  "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!