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

# Insert Transaction V2 (Batch)

> Submit one or more transactions asynchronously for bulk processing.

Accepts an array of loyalty transactions and queues them for asynchronous processing by the Rule Engine. The Rule Engine automatically calculates points for each transaction based on your program rules — you do not specify points amounts. The API returns immediately with a `batch_id`; processing happens in the background.

There is currently **no enforced batch size limit**, but keeping batches under **100 transactions** is strongly recommended for performance. A batch size limit of 100 may be enforced in a future release.

<Note>
  Timestamps are in the timezone of your deployment environment. For cloud deployments confirm the timezone with your Xoxoday implementation contact. For on-premise deployments, the server timezone applies.
</Note>

<Warning>
  `transaction_id` is **not** deduplicated server-side by default. Use `_xoxo_api_client_idempotency` for safe retries — reuse the same value when retrying, generate a new one only for a genuinely new submission. See [Idempotency](/concepts/idempotency).
</Warning>

## Responses

<AccordionGroup>
  <Accordion title="202 — Accepted">
    | Path                                                            | Type    | Description                                                                                                                    |
    | --------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------ |
    | `results.IsSucessful`                                           | boolean | `true`                                                                                                                         |
    | `results.ErrorCode`                                             | string  | `001` — note: this endpoint returns `001` (not `000`) on success                                                               |
    | `results.ExceptionMessage`                                      | string  | `Success`                                                                                                                      |
    | `results.ReturnObject.batch_id`                                 | string  | Identifies this batch — e.g. `abc_1759321530_123`. Pass to [Poll Batch Status](/api-reference/transactions/poll-batch-status). |
    | `results.ReturnObject.message`                                  | string  | `Transactions queued successfully`                                                                                             |
    | `results.ReturnObject.total_transactions`                       | integer | Number of transactions accepted into the batch                                                                                 |
    | `results.ReturnObject.transactions`                             | array   | One entry per transaction submitted in the batch                                                                               |
    | `results.ReturnObject.transactions[].member_relation_reference` | string  | The member identifier from the request                                                                                         |
    | `results.ReturnObject.transactions[].transaction_id`            | string  | The `transaction_id` from the request                                                                                          |
    | `results.ReturnObject.transactions[].transaction_type`          | string  | `dr` (debit / earn) or `cr` (credit / reversal)                                                                                |
    | `results.ReturnObject.transactions[].request_id`                | string  | Server-assigned unique ID for this queued item — use for support or tracing                                                    |

    ```json theme={null}
    {
      "results": {
        "IsSucessful": true,
        "ErrorCode": "001",
        "ExceptionMessage": "Success",
        "ReturnObject": {
          "batch_id": "abc_1759321530_123",
          "message": "Transactions queued successfully",
          "total_transactions": 3,
          "transactions": [
            {
              "member_relation_reference": "M00001",
              "transaction_id": "TXN-1001",
              "transaction_type": "dr",
              "request_id": "req_a1b2c3d4..."
            },
            {
              "member_relation_reference": "M00001",
              "transaction_id": "TXN-1001",
              "transaction_type": "cr",
              "request_id": "req_e5f6g7h8..."
            },
            {
              "member_relation_reference": "M00002",
              "transaction_id": "TXN-1002",
              "transaction_type": "dr",
              "request_id": "req_i9j0k1l2..."
            }
          ]
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml POST /lbms-ingress/transaction-lm/API/Transaction/InsertTransactionDataV2
openapi: 3.1.0
info:
  title: Loyalife LBMS API
  description: >-
    REST API for Loyalife's Loyalty Management System. Covers member management,
    OTP authentication, loyalty transactions, and points redemption.
  version: 1.0.0
  contact:
    name: Xoxoday Support
    email: support@xoxoday.com
servers:
  - url: https://loyalife-api.xoxoday.in
    description: Production
security:
  - bearerAuth: []
paths:
  /lbms-ingress/transaction-lm/API/Transaction/InsertTransactionDataV2:
    post:
      tags:
        - Transactions
      summary: Insert Transaction V2 (Batch)
      description: >-
        Submit one or more transactions asynchronously. Returns a `batch_id` for
        polling outcomes.
      operationId: insertTransactionDataV2
      parameters:
        - $ref: '#/components/parameters/pintProgramId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/TransactionItem'
              description: Array of transaction objects to process
            example:
              - transaction_id: TXN-2026-001
                _xoxo_api_client_idempotency: order-inv-2026-001
                amount: 1500
                transaction_date: '2026-05-11'
                product_code: RETAIL001
                sub_product_code: ELECTRONICS
                member_relation_reference: jane.doe@example.com
                transaction_type: dr
              - transaction_id: TXN-2026-002
                _xoxo_api_client_idempotency: order-inv-2026-002
                amount: 800
                transaction_date: '2026-05-11'
                product_code: RETAIL001
                member_relation_reference: john.smith@example.com
                transaction_type: dr
      responses:
        '202':
          description: Transactions queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: object
                    properties:
                      IsSucessful:
                        type: boolean
                      ErrorCode:
                        type: string
                      ExceptionMessage:
                        type: string
                      ReturnObject:
                        type: object
                        properties:
                          batch_id:
                            type: string
                            description: Use with Poll Batch Status
                            example: abc_1759321530_123
                          message:
                            type: string
                            example: Transactions queued successfully
                          total_transactions:
                            type: integer
                            example: 3
                          transactions:
                            type: array
                            description: One entry per transaction submitted in the batch
                            items:
                              type: object
                              properties:
                                member_relation_reference:
                                  type: string
                                transaction_id:
                                  type: string
                                transaction_type:
                                  type: string
                                  enum:
                                    - dr
                                    - cr
                                request_id:
                                  type: string
                                  description: Server-assigned unique ID for tracing
                      Count:
                        type: integer
                        example: 0
              example:
                results:
                  IsSucessful: true
                  ErrorCode: '001'
                  ExceptionMessage: Success
                  ReturnObject:
                    batch_id: abc_1759321530_123
                    message: Transactions queued successfully
                    total_transactions: 3
                    transactions:
                      - member_relation_reference: M00001
                        transaction_id: TXN-1001
                        transaction_type: dr
                        request_id: req_a1b2c3d4...
                      - member_relation_reference: M00001
                        transaction_id: TXN-1001
                        transaction_type: cr
                        request_id: req_e5f6g7h8...
                      - member_relation_reference: M00002
                        transaction_id: TXN-1002
                        transaction_type: dr
                        request_id: req_i9j0k1l2...
                  Count: 0
components:
  parameters:
    pintProgramId:
      name: pintProgramId
      in: query
      required: true
      description: Your loyalty program ID
      schema:
        type: integer
        example: 19
  schemas:
    TransactionItem:
      type: object
      required:
        - amount
        - transaction_date
        - product_code
        - member_relation_reference
        - transaction_type
      properties:
        transaction_id:
          type: string
          example: TXN-2026-001
        _xoxo_api_client_idempotency:
          type: string
          description: >-
            Idempotency key for safe retries. Reuse on retry; new value for
            genuinely new submissions.
          example: order-inv-2026-001
        amount:
          type: number
          example: 1500
        transaction_date:
          type: string
          format: date
          example: '2026-05-11'
        product_code:
          type: string
          example: RETAIL001
        sub_product_code:
          type: string
          example: ELECTRONICS
        member_relation_reference:
          type: string
          example: jane.doe@example.com
        transaction_type:
          type: string
          description: DR for purchase/earn, CR for reversal
          example: dr
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT obtained from Generate Auth Token. Pass as `Authorization: bearer
        {token}`.

````