Initiate Cashback Delivery
POSThttps://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
- application/json
Bodyrequired
The unique identifier of the user receiving the cashback.
8GAVZZKTI3
The payment method used in the transaction (e.g., "pay_id").
pay_id
A unique identifier for the transaction on the client's side to prevent duplicate processing.
delivery_8263e133e2
The total amount of the purchase for which cashback is applicable, in minor units (e.g., 500 for $5.00).
500
The date of the transaction in "YYYY-MM-DD" format.
2024-10-09
The time of the transaction in "HH:mm:ss" format.
00:00:11
The unique identifier (UUID) of the cashback campaign associated with this transaction.
LOQVYIM0
The currency code of the transaction, following ISO 4217 standards (e.g., "aud" for Australian Dollar). Default is "aud".
aud
webhook_notification objectrequired
Responses
- 200
- 400
- 401
Cashback delivered successfully.
- application/json
- Schema
- Example (auto)
Schema
The unique identifier for this cashback transaction in Hello Clever's system.
JTDOL51K
The client's unique transaction identifier.
8263e133e2
The type of transaction, indicating the flow of money (e.g., "money_in" for cashback deposits).
money_in
The unique identifier for the balance transaction in Hello Clever's dashboard linked to this transaction.
B283A882-18A4C85E
The unique identifier of the cashback campaign.
NBAOZMPR
The unique identifier of the site where the transaction occurred.
3BAVFJ6H
The total amount of the purchase for which cashback applies, in major units (e.g., 500.0 for $500.00).
500
The payment method used in the transaction.
pay_id
The unique identifier of the customer receiving the cashback.
8GAVZZKTI3
The amount of cashback awarded in the transaction, in major units.
25
The status of the cashback transaction. Possible values are "created", "processing", "settled", or "failed".
settled
The timestamp when the transaction was created.
2024-11-06T16:49:44.402Z
The timestamp when the transaction was last updated.
2024-11-06T16:49:44.402Z
The date of the transaction as provided by the client.
2024-10-09
The time of the transaction as provided by the client.
00:00:11
webhook_notification object
{
"id": "JTDOL51K",
"client_transaction_id": "8263e133e2",
"transaction_type": "money_in",
"balance_id": "B283A882-18A4C85E",
"campaign_id": "NBAOZMPR",
"site_id": "3BAVFJ6H",
"purchase_amount": 500,
"payment_method": "pay_id",
"customer_id": "8GAVZZKTI3",
"cashback_amount": 25,
"status": "settled",
"created_at": "2024-11-06T16:49:44.402Z",
"updated_at": "2024-11-06T16:49:44.402Z",
"transaction_date": "2024-10-09",
"transaction_time": "00:00:11",
"webhook_notification": {
"endpoint_url": "https://merchant.example.com/webhook",
"authorization_headers": "Bearer your_token"
}
}
Bad Request
Unauthorized
Callbacks
- POST cashbackDeliveryCallback
POST{$request.body#/webhook_notification/endpoint_url}
- application/json
Bodyrequired
The unique identifier for the cashback transaction.
The client's unique transaction identifier.
The type of transaction ("money_in").
The unique identifier for the balance transaction.
The unique identifier of the cashback campaign.
The unique identifier of the site.
The purchase amount.
The payment method used.
The customer's unique identifier.
The cashback amount awarded.
The status of the transaction ("settled" or "failed").
The timestamp when the transaction was created.
The timestamp when the transaction was last updated.
The date of the transaction.
The time of the transaction.
webhook_notification object
Callbacks Responses
- 200
- 400
- 401
Callback received successfully.
Bad Request - Invalid data received.
Unauthorized - Authentication failed for the callback.
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/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());