> ## Documentation Index
> Fetch the complete documentation index at: https://developers.bonifiq.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Redeems cashback for a checkout

> This endpoint allows you to apply cashback discount to a checkout/cart.

## Input Parameters
- `CustomerId` (required): The customer identifier (email or document/CPF)
- `CheckoutId` (required): The checkout/cart ID from the e-commerce platform
- `CashbackValue` (optional): The specific amount of cashback to apply. If not provided, the maximum available cashback will be used.
- `Total` (optional): The checkout total value. Used for validation.
- `OriginalKey` (optional): A unique key to identify this redemption (for idempotency)
- `RedeemOrigin` (optional): The origin of the redeem request

## Response
On success, returns the reward information including:
- `RewardId`: The unique ID for this reward
- `ExternalCode`: Code to be used when sending orders to BonifiQ
- `OriginalKey`: The key identifying this redemption
- `Point`: Information about the points used
- `Coupon`: The coupon information (if generated)

## Important Notes
- If the customer already has cashback applied in another checkout (without an order), it will be automatically refunded.
- The cashback value cannot exceed the checkout total or the customer's available cashback balance.



## OpenAPI

````yaml https://api.bonifiq.com.br/swagger/Private%20APIs/swagger.json post /v1/pvt/Checkout/redeem
openapi: 3.0.0
info:
  title: BonifiQ Private APIs
  description: >-
    # Introduction 

    This is the BonifiQ Private APIs documentation. With these endpoints you can
    interact with BonifiQ systems and enhance your program points.


    # Limitations

    These endpoints are intended to be used in backend communication so they are
    not CORS-compatible and cannot be used by in-browser frontend libraries
    (such as React, Angular, Vue, jQuery, etc)


    If are required to call BonifiQ API from a browser, please refer to our
    [Public APIs](https://api.bonifiq.com.br/apidocs/public)


    # Authentication

    These Private APis use the [Basic
    Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)
    scheme. You need both an API Token (Username) and API Key (Password) to use
    with it


    You can generate this key pair in BonifiQ admin panel, at the "API Keys"
    menu.


    # How to use this page

    ## Making calls

    You can simulate, test and make calls to API from this Swagger page. To do
    that:

    - Click on the **Authorize** button

    - Inform the Username (API Token) and Passwoird (API Key) and click on
    **Authorize**

    - From the list bellow, choose an API call and click on **Try it out**

    - Inform the required parameters (if any) and click on **Execute**


    ## Verifying requests and responses bodies

    In every API Call there is an explanation of what each field means, theirs
    types and accepted values for all Requests and Responses.


    To view this information, just go to any API Call bellow and in the
    Responses section, click on the Schema.
  version: 1.0.0
servers:
  - url: https://api.bonifiq.com.br
security: []
tags:
  - name: POS
    description: >-
      Flow methods to integrate BonifiQ with a POS system. Check the Flow
      Documentation link on the right
    externalDocs:
      description: Flow Documentation
      url: >-
        https://suporte.bonifiq.com.br/support/solutions/articles/159000319538-integrar-com-pdv
  - name: Checkout
    description: Operations related to checkout cashback redeem, refresh and removal
  - name: Customization
    description: Retrieve customizations for the loyalty program
  - name: Rewards
    description: Interact with rewards already redeemed
paths:
  /v1/pvt/Checkout/redeem:
    post:
      tags:
        - Checkout
      summary: Redeems cashback for a checkout
      description: >-
        This endpoint allows you to apply cashback discount to a checkout/cart.


        ## Input Parameters

        - `CustomerId` (required): The customer identifier (email or
        document/CPF)

        - `CheckoutId` (required): The checkout/cart ID from the e-commerce
        platform

        - `CashbackValue` (optional): The specific amount of cashback to apply.
        If not provided, the maximum available cashback will be used.

        - `Total` (optional): The checkout total value. Used for validation.

        - `OriginalKey` (optional): A unique key to identify this redemption
        (for idempotency)

        - `RedeemOrigin` (optional): The origin of the redeem request


        ## Response

        On success, returns the reward information including:

        - `RewardId`: The unique ID for this reward

        - `ExternalCode`: Code to be used when sending orders to BonifiQ

        - `OriginalKey`: The key identifying this redemption

        - `Point`: Information about the points used

        - `Coupon`: The coupon information (if generated)


        ## Important Notes

        - If the customer already has cashback applied in another checkout
        (without an order), it will be automatically refunded.

        - The cashback value cannot exceed the checkout total or the customer's
        available cashback balance.
      operationId: Checkout_RedeemCashback
      requestBody:
        x-name: request
        description: The redeem request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalApiCheckoutRedeemRequest'
        required: true
        x-position: 1
      responses:
        '200':
          description: The reward information
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BaseExternalApiResponseOfCouponlessRewardRedeemResponse
      security:
        - Basic Authentication: []
components:
  schemas:
    ExternalApiCheckoutRedeemRequest:
      type: object
      description: Request to redeem cashback in a checkout
      additionalProperties: false
      properties:
        CustomerId:
          type: string
          description: Customer identifier (email or document/CPF)
        CheckoutId:
          type: string
          description: The checkout/cart ID from the e-commerce platform
        CashbackValue:
          type: number
          description: |-
            Optional: The specific amount of cashback to apply. 
            If not provided, the maximum available cashback will be used.
          format: decimal
          nullable: true
        Total:
          type: number
          description: 'Optional: The checkout total value. Used for validation.'
          format: decimal
          nullable: true
        Token:
          type: string
          description: 'Optional: Platform-specific token for the checkout'
          nullable: true
        OriginalKey:
          type: string
          description: 'Optional: A unique key to identify this redemption (for idempotency)'
          nullable: true
        RedeemOrigin:
          description: 'Optional: The origin of the redeem request'
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/RedeemOrigin'
        Items:
          type: array
          description: >-
            Optional: List of order items for cashback eligibility validation.

            If provided, only eligible items will be considered for cashback
            calculation.

            If not provided, the full order total will be used (backward
            compatible behavior).
          nullable: true
          xml:
            wrapped: true
          items:
            xml:
              name: ExternalApiCheckoutOrderItem
            oneOf:
              - $ref: '#/components/schemas/ExternalApiCheckoutOrderItem'
    BaseExternalApiResponseOfCouponlessRewardRedeemResponse:
      type: object
      description: Standard response envelope used by the External API.
      additionalProperties: false
      properties:
        ErrorMessage:
          type: string
          description: >-
            Error message returned when the request fails validation or
            processing.

            For warnings and successful responses, consumers should usually
            inspect `Result`, `Code` and `Severity` first.
          nullable: true
        ErrorCode:
          type: integer
          description: >-
            Legacy numeric error code derived from internal API errors when
            available.

            This field is relevant only for error flows that use
            `ApiResponseErrorDescription`.
          format: int32
          nullable: true
        Result:
          description: Business payload returned by the endpoint.
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/CouponlessRewardRedeemResponse'
        Code:
          type: string
          description: >-
            Endpoint-specific business code formatted as a two-digit string,
            such as `03` or `07`.

            This field is available for success, warning and error outcomes.
          nullable: true
        CodeName:
          type: string
          description: >-
            Symbolic enum name associated with `Code`, such as
            `CheckoutNotFound`.
          nullable: true
        Severity:
          description: >-
            Final severity of the response.

            `Success` means the action completed as expected, `Warning` means
            the request was valid but the business outcome is informational or
            non-ideal, and `Error` means the request should be treated as a
            failure.
          oneOf:
            - $ref: '#/components/schemas/ExternalApiResponseSeverity'
        HasWarning:
          type: boolean
          description: >-
            Convenience flag that is `true` when `Severity` is `Warning`.

            Warnings are valid `200 OK` business outcomes and should not be
            handled as transport or validation errors.
        HasError:
          type: boolean
          description: >-
            Indicates whether the request failed and should be handled as an
            error response.

            This flag is reserved for real API errors; warnings must keep this
            property as `false`.
    RedeemOrigin:
      type: integer
      description: |-
        0 = LandingPage
        1 = Widget
        2 = Copilot
        3 = Checkout
        4 = API
        5 = PDV
      x-enumNames:
        - LandingPage
        - Widget
        - Copilot
        - Checkout
        - API
        - PDV
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
    ExternalApiCheckoutOrderItem:
      type: object
      description: >-
        Represents an order item for cashback eligibility validation in external
        API
      additionalProperties: false
      properties:
        ExternalProductId:
          type: string
          description: External product identifier from the e-commerce platform
          nullable: true
        Value:
          type: number
          description: Item value (price * quantity)
          format: decimal
        Quantity:
          type: integer
          description: Quantity of the item
          format: int32
    CouponlessRewardRedeemResponse:
      type: object
      additionalProperties: false
      properties:
        RewardId:
          type: integer
          description: This is the unique-id for this reward
          format: int32
        Point:
          description: It`s the underlining point record generating from using this reward
          oneOf:
            - $ref: '#/components/schemas/CouponlessRewardRedeemPointResponse'
        ExternalCode:
          type: string
          description: >-
            When sending orders to BonifiQ use this field value in the `Coupon`
            field for the Order

            This is necessary so we know that this order used this reward
        OriginalKey:
          type: string
          description: This is the key that was send in the redeem request
        Coupon:
          description: If the request forces the coupon generation It is returned here
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/RewardRedeemCoupon'
    ExternalApiResponseSeverity:
      type: integer
      description: |-
        0 = Success
        1 = Warning
        2 = Error
      x-enumNames:
        - Success
        - Warning
        - Error
      enum:
        - 0
        - 1
        - 2
    CouponlessRewardRedeemPointResponse:
      type: object
      additionalProperties: false
      properties:
        PointId:
          type: integer
          format: int32
        Quantity:
          type: integer
          format: int32
        Metadatas:
          type: array
          nullable: true
          xml:
            wrapped: true
          items:
            xml:
              name: ExternalApiPointMetadata
            oneOf:
              - $ref: '#/components/schemas/ExternalApiPointMetadata'
    RewardRedeemCoupon:
      type: object
      additionalProperties: false
      properties:
        CouponCode:
          type: string
        CouponType:
          $ref: '#/components/schemas/CouponType'
        CouponValue:
          type: number
          format: decimal
        ValidDateStart:
          type: string
          format: date-time
          nullable: true
        ValidDateEnd:
          type: string
          format: date-time
          nullable: true
    ExternalApiPointMetadata:
      type: object
      additionalProperties: false
      properties:
        Name:
          type: string
        Value:
          type: string
    CouponType:
      type: integer
      description: |-
        0 = FixedValue
        1 = Percent
        2 = FreeShipping
        3 = DiscountShipping
        4 = Others
      x-enumNames:
        - FixedValue
        - Percent
        - FreeShipping
        - DiscountShipping
        - Others
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
  securitySchemes:
    Basic Authentication:
      type: http
      description: Use API Basic Auth Keys
      name: Basic Authentication
      in: header
      scheme: basic

````