---
title: 'Create Loyalty Transaction'
description: 'Create a loyalty transaction to update account balances.'
openapi: POST /api/loyalty/transactions
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://docs.snagsolutions.io/llms.txt). Append `.md` to any page URL for its markdown version.

`POST /api/loyalty/transactions`

`POST https://admin.snagsolutions.io/api/loyalty/transactions`

Create a loyalty transaction to update account balances.

## Authentication

- `apiKeyAuth` — apiKey in header: `X-API-KEY`

## Request body

- Content type: `application/json`
  - request body (object) — Schema for creating a loyalty transaction
    - `description` (string, required) — Description of the loyalty transaction
    - `entries` (array, required) — Array of transaction entries
      - `items` (object)
        - `walletAddress` (string) — The wallet address of the user
        - `direction` (string, one of: credit, debit) — Direction of the transaction entry for this wallet address
        - `amount` (number, required) — Transaction entry amount.
        - `idempotencyKey` (string) — Idempotency key for the transaction entry. Creation will fail if already exists for this wallet address.
        - `loyaltyCurrencyId` (string, uuid) — Unique identifier for the loyalty currency for the wallet. Can only use entry-level currency or transaction-level currency.
    - `loyaltyCurrencyId` (string, uuid) — Unique identifier for the loyalty currency
    - `websiteId` (string, uuid)
    - `organizationId` (string, uuid)

## Response 200

200
  - response (object)
    - `id` (string, uuid, required)
    - `description` (string, required)
    - `entries` (array, required)
      - `items` (object)
        - `walletAddress` (string, required)
        - `amount` (number, required)
        - `direction` (string, required, one of: credit, debit) — Direction of the transaction entry
        - `idempotencyKey` (string)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)

## Response 400

400
  - response (object) — Schema for bad request response
    - `message` (string, required) — Error message

## Response 403

403
  - response (object) — Schema for forbidden response
    - `message` (string, required) — Error message

## Response 500

500
  - response (object) — Schema for internal server error response
    - `success` (boolean, required) — Indicates operation success
    - `message` (string, required) — Error message
    - `debugInfo` (string) — Optional debug information


---

📦 **OpenAPI specs:** Every OpenAPI specification referenced by this documentation is available as a single download — https://docs.snagsolutions.io/api-specs.zip
