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

> Submit a synchronous loyalty transaction for a member.

Submits a single loyalty transaction and returns the result synchronously after the Loyalife Rule Engine has evaluated it. The Rule Engine automatically calculates how many points to award based on your program's configured rules — you do not specify a points amount in the request. Rules can evaluate multiple attributes including transaction `amount`, `product_code`, `transaction_type`, member tier, and any custom attributes defined in your program. If no rule matches the transaction, the transaction succeeds but zero points are awarded — `IsSucessful` will still be `true`.

Use this for real-time integrations where you need the outcome before responding to the customer. For bulk or end-of-day uploads, use [Insert Transaction V2](/api-reference/transactions/insert-transaction-v2) instead.

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

## Responses

<AccordionGroup>
  <Accordion title="200 — Success">
    | Path                       | Type    | Description                     |
    | -------------------------- | ------- | ------------------------------- |
    | `results.IsSucessful`      | boolean | `true`                          |
    | `results.ErrorCode`        | string  | `000`                           |
    | `results.ExceptionMessage` | string  | `Success`                       |
    | `results.ReturnObject`     | boolean | `true` on successful submission |
  </Accordion>

  <Accordion title="400 — Invalid Request">
    | Path                       | Type    | Description                                                                  |
    | -------------------------- | ------- | ---------------------------------------------------------------------------- |
    | `results.IsSucessful`      | boolean | `false`                                                                      |
    | `results.ErrorCode`        | string  | Error code from the platform                                                 |
    | `results.ExceptionMessage` | string  | Human-readable reason, e.g. `Invalid product code` — always check this field |
  </Accordion>
</AccordionGroup>

***

## Error Codes

| Code  | ExceptionMessage                   | Cause                                                      |
| ----- | ---------------------------------- | ---------------------------------------------------------- |
| `000` | Success                            | Transaction accepted and queued for Rule Engine processing |
| `006` | Insert failed                      | Transaction could not be inserted                          |
| `103` | Member does not exist              | `member_relation_reference` not found in the program       |
| `201` | Failed to award points             | Points calculation or award step failed                    |
| `209` | Transaction reference missing      | `transaction_id` not provided                              |
| `210` | Request DateTime invalid / missing | `transaction_date` is missing or in the wrong format       |
| `997` | Exception occurred                 | Unexpected server-side error                               |
| `999` | Bad request                        | Malformed payload or missing required fields               |


## OpenAPI

````yaml POST /lbms-ingress/transaction-lm/API/Transaction/InsertTransactionData
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/InsertTransactionData:
    post:
      tags:
        - Transactions
      summary: Insert Transaction
      description: >-
        Submit a synchronous loyalty transaction. Processed immediately by the
        Rule Engine.
      operationId: insertTransactionData
      parameters:
        - $ref: '#/components/parameters/pintProgramId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - transaction_id
                - amount
                - transaction_date
                - product_code
                - member_relation_reference
                - transaction_type
              properties:
                transaction_id:
                  type: string
                  description: Your unique transaction reference
                  example: TXN-2026-001
                amount:
                  type: number
                  example: 1500
                transaction_date:
                  type: string
                  format: date
                  example: '2026-05-11'
                product_code:
                  type: string
                  description: Product or merchant code as configured in your program
                  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 debit (purchase/earn), CR for credit (reversal)
                  example: DR
            example:
              transaction_id: TXN-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
      responses:
        '200':
          description: Transaction accepted
          content:
            application/json:
              example:
                results:
                  IsSucessful: true
                  ErrorCode: '000'
                  ExceptionMessage: Success
                  ReturnObject: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardError'
              example:
                results:
                  IsSucessful: false
                  ErrorCode: E400
                  ExceptionMessage: Invalid product code
components:
  parameters:
    pintProgramId:
      name: pintProgramId
      in: query
      required: true
      description: Your loyalty program ID
      schema:
        type: integer
        example: 19
  schemas:
    StandardError:
      type: object
      properties:
        results:
          type: object
          properties:
            IsSucessful:
              type: boolean
              example: false
            ErrorCode:
              type: string
              example: E400
            ExceptionMessage:
              type: string
              example: Error description
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT obtained from Generate Auth Token. Pass as `Authorization: bearer
        {token}`.

````