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

# Refund

> Process refunds for previous point redemption transactions.

## Refund

Process refunds for previous point redemption transactions.

<Info>
  Security: Provide both `apikey` and `secretkey` headers.
</Info>


## OpenAPI

````yaml POST /api/v4.0/integrations/transactions/refund
openapi: 3.1.0
info:
  title: Gameball API
  description: >-
    Gameball REST API v4.0 - Complete API reference for integrating loyalty,
    gamification, and customer engagement features
  version: 4.0.0
servers:
  - url: https://api.gameball.co
security:
  - bearerAuth: []
paths:
  /api/v4.0/integrations/transactions/refund:
    post:
      description: >-
        This API processes refunds or cancellations of cashback and points
        redemption transactions in Gameball. By providing a
        reverseTransactionId, Gameball identifies the related cashback or
        redemption transaction and adjusts the customer's points balance
        accordingly to reflect the refunded or canceled transaction.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customerId
                - refundTransactionId
                - reverseTransactionId
                - transactionTime
              properties:
                customerId:
                  type: string
                  description: >-
                    Unique identifier for the customer that you can reference
                    across the customer's whole lifetime. Could be a database
                    ID, random string, email, or anything that uniquely
                    identifies the customer.
                  example: cust_12345abc
                email:
                  type: string
                  description: >-
                    Customer's email address. This is required if your account
                    uses email-based channel merging.
                  example: john.doe@example.com
                mobile:
                  type: string
                  description: >-
                    Customer's mobile number. This is required if your account
                    uses mobile-based channel merging.
                  example: '+1234567890'
                refundTransactionId:
                  type: string
                  description: >-
                    A unique identifier for the refund process transaction in
                    your system (e.g., refund number or transaction ID). This ID
                    helps track and reference the refund process itself.
                    Example: If a refund is processed for an item, the
                    refundTransactionId could be REFUND-98765, which refers to
                    the specific new refund transaction.
                  example: txn987657111
                reverseTransactionId:
                  type: string
                  description: >-
                    The unique transaction ID representing the original order
                    being refunded, reversed, or canceled. This ID is sent as
                    reverseTransactionId in the payload and links to the
                    previous transaction. Example: If a customer requests a
                    refund for an order previously made with transaction ID
                    ORDER-12345, the reverseTransactionId will be ORDER-12345 to
                    indicate which order is being refunded.
                  example: txn6342347194477
                transactionTime:
                  type: string
                  format: date-time
                  description: >-
                    The timestamp of the original transaction in your system
                    (e.g., order datetime, invoice datetime).
                  example: '2024-10-13T17:11:00.249Z'
                refundAmount:
                  type: number
                  description: >-
                    The amount to be refunded from the original transaction. The
                    entire transaction is refunded if this field is not
                    provided. Note: For a full refund, you can use any of the
                    following approaches: Send the refund request without the
                    refundAmount field, Send the refund request with
                    refundAmount set to null, Send the refund request with
                    refundAmount equal to the total paid in the original order.
                  example: 15
                merchant:
                  type: object
                  description: >-
                    This object contains details about the specific merchant
                    involved in the transaction, which is particularly important
                    for businesses managing multiple merchants or branches under
                    the same Gameball account. This object can provide
                    identifying information about both the main merchant and any
                    associated branch where the transaction took place.
                  properties:
                    uniqueId:
                      type: string
                      description: Unique identifier for the merchant.
                    name:
                      type: string
                      description: Name of the merchant.
                    branch:
                      type: object
                      required:
                        - uniqueId
                      properties:
                        uniqueId:
                          type: string
                          description: >-
                            Unique identifier for the branch where the
                            transaction took place.
                        name:
                          type: string
                          description: Name of the branch where the transaction took place.
                lineItems:
                  type: array
                  description: >-
                    An array of items from the original transaction that are
                    being refunded. If provided, only the items listed in this
                    array will be refunded from the reverseTransactionId. If
                    this field is not provided, the entire transaction specified
                    by the reverseTransactionId will be refunded.
                  items:
                    type: object
                    properties:
                      productId:
                        type: string
                        description: >-
                          Unique identifier for the product or service being
                          purchased.
                      quantity:
                        type: number
                        description: Number of units purchased for this product or service.
                      price:
                        type: number
                        description: >-
                          The original price of a single product before any tax
                          or discount is applied. This reflects the cost of one
                          unit of the item, not the total for multiple
                          quantities in an order. Example: If the original price
                          of a product is $50 and a customer buys two units, the
                          price for each item would still be recorded as $50,
                          regardless of quantity.
                      sku:
                        type: string
                        description: Stock Keeping Unit (SKU) for the product.
                      tags:
                        type: array
                        items:
                          type: string
                        description: >-
                          Tags associated with the product for categorization or
                          promotional purposes.
                      category:
                        type: array
                        items:
                          type: string
                        description: >-
                          Product category, such as fashion or electronics. It
                          can include one or multiple categories. Example:
                          ["natural", "cosmetics"]
                      weight:
                        type: number
                        description: Weight of the product.
                      vendor:
                        type: string
                        description: Vendor or manufacturer of the product.
                      collection:
                        type: array
                        items:
                          type: string
                        description: >-
                          Collection ID(s) to which the product belongs. It can
                          include one or multiple collections. Example:
                          ["14313", "4343"]
                      title:
                        type: string
                        description: Product title or name.
                      taxes:
                        type: number
                        description: >-
                          The total amount of taxes applied to the line item,
                          expressed in the shop's currency. This amount must be
                          positive and reflects the total taxes based on the
                          quantity of the item.
                      discount:
                        type: number
                        description: >-
                          The total discount applied to this line item,
                          expressed as a positive value. This amount should
                          reflect the total discounts based on the quantity of
                          the item.
                      extra:
                        type: object
                        additionalProperties: true
                        description: >-
                          Key-value pairs containing any extra information about
                          the product, such as size, color, or other custom
                          attributes. The values must be of type string or
                          number.
      responses:
        '200':
          description: Refund processed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  gameballTransactionId:
                    type: string
                    description: >-
                      Unique identifier for the refund transaction in the
                      Gameball system.
                    example: '11034735'
                  refundTransactionId:
                    type: string
                    description: >-
                      Unique identifier for the refund process transaction in
                      your system (e.g., refund number or transaction ID). This
                      ID helps track and reference the refund process itself.
                      Example: If the refund process for an order has a
                      transaction ID REFUND-54321, this ID will be used to track
                      the refund operation.
                    example: txn987657111
                  refundAmount:
                    type: number
                    description: >-
                      The amount refunded from the original transaction.
                      Example: If a customer was originally charged $100 and you
                      refunded $40, the refundAmount will be 40.
                    example: 15
                  refundEquivalentPoints:
                    type: number
                    description: >-
                      The number of points equivalent to the monetary value
                      refunded in the transaction. Example: If $40 is refunded
                      and your points-to-currency ratio is 1 point = $0.10, then
                      the refundEquivalentPoints would be 400 points.
                    example: 150
      security:
        - apiKey: []
          secretKey: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: apikey
    secretKey:
      type: apiKey
      in: header
      name: secretkey

````