> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rc.cleverhub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Initiate Cashback Delivery

> 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.




## OpenAPI

````yaml /api/openapi/cashback-reference.yaml post /v2/cashbacks/deliver
openapi: 3.0.3
info:
  title: Cashback APIs
  description: >-
    ## Introduction

    The Cashback API Solution offers a streamlined way for developers to manage
    cashback campaigns, account activations, and withdrawals, providing a
    seamless user experience.

    ### Key Features

    - **Campaign Management**:
      - **Get Cashback Campaign List**: Retrieve a list of all available cashback campaigns.
      - **Get Campaign Configurations**: Retrieve detailed configurations for specific cashback campaigns.

    - **User Cashback Management**:
      - **Activate User's Cashback Account**: Activate a cashback account for a user.
      - **Initiate Cashback Delivery**: Initiate the delivery of cashback to a user.
      - **Initiate Cashback Withdrawal**: Begin the process of withdrawing cashback to a user's account.

    - **User Information**:
      - **Get User List**: Retrieve a list of users with cashback accounts.

    This documentation provides detailed guidance for integrating these
    capabilities into your application.
  version: 2.0.0
  termsOfService: https://helloclever.co/terms
  contact:
    email: support@helloclever.co
servers:
  - url: https://api.cleverhub.co/api
    description: Sandbox Environment
  - url: https://api-merchant.helloclever.co/api
    description: Production Environment
security: []
paths:
  /v2/cashbacks/deliver:
    post:
      tags:
        - Cashback
      summary: Initiate Cashback Delivery
      description: >
        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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - payment_method
                - client_transaction_id
                - purchase_amount
                - campaign_id
                - currency
                - webhook_notification
              properties:
                user_id:
                  type: string
                  description: The unique identifier of the user receiving the cashback.
                  example: 8GAVZZKTI3
                payment_method:
                  type: string
                  description: The payment method used in the transaction (e.g., "pay_id").
                  example: pay_id
                client_transaction_id:
                  type: string
                  description: >-
                    A unique identifier for the transaction on the client's side
                    to prevent duplicate processing.
                  example: delivery_8263e133e2
                purchase_amount:
                  type: integer
                  description: >-
                    The total amount of the purchase for which cashback is
                    applicable, in minor units (e.g., 500 for $5.00).
                  example: 500
                transaction_date:
                  type: string
                  format: date
                  description: The date of the transaction in "YYYY-MM-DD" format.
                  example: '2024-10-09'
                transaction_time:
                  type: string
                  format: time
                  description: The time of the transaction in "HH:mm:ss" format.
                  example: '00:00:11'
                campaign_id:
                  type: string
                  description: >-
                    The unique identifier (UUID) of the cashback campaign
                    associated with this transaction.
                  example: LOQVYIM0
                currency:
                  type: string
                  description: >-
                    The currency code of the transaction, following ISO 4217
                    standards (e.g., "aud" for Australian Dollar). Default is
                    "aud".
                  example: aud
                webhook_notification:
                  type: object
                  required:
                    - endpoint_url
                    - authorization_headers
                  description: >-
                    Details for sending a webhook notification after processing
                    the transaction.
                  properties:
                    endpoint_url:
                      type: string
                      format: uri
                      description: The URL to which the webhook will be sent.
                      example: https://merchant.example.com/webhook
                    authorization_headers:
                      type: string
                      description: >-
                        Authorization headers for securing the webhook
                        notification.
                      example: Bearer your_token
      responses:
        '200':
          description: Cashback delivered successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      The unique identifier for this cashback transaction in
                      Hello Clever's system.
                    example: JTDOL51K
                  client_transaction_id:
                    type: string
                    description: The client's unique transaction identifier.
                    example: 8263e133e2
                  transaction_type:
                    type: string
                    description: >-
                      The type of transaction, indicating the flow of money
                      (e.g., "money_in" for cashback deposits).
                    example: money_in
                  balance_id:
                    type: string
                    description: >-
                      The unique identifier for the balance transaction in Hello
                      Clever's dashboard linked to this transaction.
                    example: B283A882-18A4C85E
                  campaign_id:
                    type: string
                    description: The unique identifier of the cashback campaign.
                    example: NBAOZMPR
                  site_id:
                    type: string
                    description: >-
                      The unique identifier of the site where the transaction
                      occurred.
                    example: 3BAVFJ6H
                  purchase_amount:
                    type: number
                    format: float
                    description: >-
                      The total amount of the purchase for which cashback
                      applies, in major units (e.g., 500.0 for $500.00).
                    example: 500
                  payment_method:
                    type: string
                    description: The payment method used in the transaction.
                    example: pay_id
                  customer_id:
                    type: string
                    description: >-
                      The unique identifier of the customer receiving the
                      cashback.
                    example: 8GAVZZKTI3
                  cashback_amount:
                    type: number
                    format: float
                    description: >-
                      The amount of cashback awarded in the transaction, in
                      major units.
                    example: 25
                  status:
                    type: string
                    description: >-
                      The status of the cashback transaction. Possible values
                      are "created", "processing", "settled", or "failed".
                    example: settled
                  created_at:
                    type: string
                    format: date-time
                    description: The timestamp when the transaction was created.
                    example: '2024-11-06T16:49:44.402Z'
                  updated_at:
                    type: string
                    format: date-time
                    description: The timestamp when the transaction was last updated.
                    example: '2024-11-06T16:49:44.402Z'
                  transaction_date:
                    type: string
                    format: date
                    description: The date of the transaction as provided by the client.
                    example: '2024-10-09'
                  transaction_time:
                    type: string
                    format: time
                    description: The time of the transaction as provided by the client.
                    example: '00:00:11'
                  webhook_notification:
                    type: object
                    description: Configuration for sending webhook notifications.
                    properties:
                      endpoint_url:
                        type: string
                        format: uri
                        description: The URL where the webhook will be sent.
                        example: https://merchant.example.com/webhook
                      authorization_headers:
                        type: string
                        description: Authorization headers for the webhook.
                        example: Bearer your_token
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      callbacks:
        cashbackDeliveryCallback:
          '{$request.body#/webhook_notification/endpoint_url}':
            post:
              summary: Callback When Cashback Delivery Status Changes
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The unique identifier for the cashback transaction.
                        client_transaction_id:
                          type: string
                          description: The client's unique transaction identifier.
                        transaction_type:
                          type: string
                          description: The type of transaction ("money_in").
                        balance_id:
                          type: string
                          description: The unique identifier for the balance transaction.
                        campaign_id:
                          type: string
                          description: The unique identifier of the cashback campaign.
                        site_id:
                          type: string
                          description: The unique identifier of the site.
                        purchase_amount:
                          type: number
                          format: float
                          description: The purchase amount.
                        payment_method:
                          type: string
                          description: The payment method used.
                        customer_id:
                          type: string
                          description: The customer's unique identifier.
                        cashback_amount:
                          type: number
                          format: float
                          description: The cashback amount awarded.
                        status:
                          type: string
                          description: >-
                            The status of the transaction ("settled" or
                            "failed").
                        created_at:
                          type: string
                          format: date-time
                          description: The timestamp when the transaction was created.
                        updated_at:
                          type: string
                          format: date-time
                          description: The timestamp when the transaction was last updated.
                        transaction_date:
                          type: string
                          format: date
                          description: The date of the transaction.
                        transaction_time:
                          type: string
                          format: time
                          description: The time of the transaction.
                        webhook_notification:
                          type: object
                          description: Configuration for the webhook notification.
                          properties:
                            endpoint_url:
                              type: string
                              format: uri
                              description: The webhook endpoint URL.
                            authorization_headers:
                              type: string
                              description: The authorization headers for the webhook.
              responses:
                '200':
                  description: Callback received successfully.
                '400':
                  description: Bad Request - Invalid data received.
                '401':
                  description: Unauthorized - Authentication failed for the callback.
              method: post
              type: path
            path: '{$request.body#/webhook_notification/endpoint_url}'
      security:
        - app-id: []
          secret-key: []
components:
  securitySchemes:
    app-id:
      type: apiKey
      in: header
      name: app-id
      description: |
        A unique identifier assigned to each application.
    secret-key:
      type: apiKey
      in: header
      name: secret-key
      description: |
        A secure token associated with the `app-id`.

````

## Related topics

- [Cashback API Overview](/api/cashback/overview.md)
- [Drive Loyalty with Cashback Campaigns](/developer-reference/api-use-cases/drive-loyalty-with-cashback-campaigns.md)
- [Initiate Cashback Withdrawal](/api/cashback/initiate-cashback-withdrawal.md)
