title: Stored Value Balance Operation
type: object
x-tags:
  - Models
description: A receipt for a stored-value top-up, redemption or reversal. amount excludes any top-up bonus;
  balance_delta includes the full change. The balance and expiry are the values recorded when the operation
  completed.
required:
  - operation_uuid
  - operation_type
  - customer_uuid
  - loyalty_program_uuid
  - loyalty_program_type
  - loyalty_balance_uuid
  - merchant_reference
  - outlet_uuid
  - amount
  - balance_delta
  - balance_after
  - balance_expires_at_after
  - ledger_entries
  - created_at
properties:
  operation_uuid:
    type: string
    format: uuid
  operation_type:
    $ref: ./StoredValueBalanceMutationType.yaml
  customer_uuid:
    type: string
    format: uuid
  loyalty_program_uuid:
    type: string
    format: uuid
  loyalty_program_type:
    type: string
    enum:
      - stored_value
  loyalty_balance_uuid:
    type: string
    format: uuid
  merchant_reference:
    type:
      - string
      - "null"
    minLength: 1
    maxLength: 255
    description: Your reference for this operation. It is case-sensitive and must be unique across the merchant's
      loyalty operations.
    pattern: ^[\x21-\x7E]+$
  reason:
    type:
      - string
      - "null"
    minLength: 1
    maxLength: 10000
    description: Included on top-ups and reversals. A top-up without a reason returns null; reversals require a
      reason. Omitted on redemptions.
  outlet_uuid:
    type: string
    format: uuid
    description: The outlet recorded for this operation. Reversals keep the original operation's outlet.
  amount:
    $ref: ./PositiveMoney.yaml
  balance_delta:
    $ref: ./Money.yaml
  balance_after:
    $ref: ./Money.yaml
  balance_expires_at_after:
    type:
      - string
      - "null"
    format: date-time
    pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$
  ledger_entries:
    type: array
    minItems: 1
    items:
      $ref: ./StoredValueBalanceLedgerEntry.yaml
  created_at:
    type: string
    format: date-time
    pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$
  reverses_operation_uuid:
    type: string
    format: uuid
    description: The original operation that this reversal compensates. Only included on reversals.
example:
  operation_uuid: 00000000-0000-0000-0000-000000000022
  operation_type: top_up
  customer_uuid: 00000000-0000-0000-0000-000000000001
  loyalty_program_uuid: 00000000-0000-0000-0000-000000000020
  loyalty_program_type: stored_value
  loyalty_balance_uuid: 00000000-0000-0000-0000-000000000021
  merchant_reference: top-up-001
  outlet_uuid: 00000000-0000-0000-0000-000000000004
  reason: null
  amount:
    amount: 2000
    currency: SGD
  balance_delta:
    amount: 2000
    currency: SGD
  balance_after:
    amount: 2000
    currency: SGD
  balance_expires_at_after: null
  ledger_entries:
    - uuid: 00000000-0000-0000-0000-000000000122
      type: top_up
      delta:
        amount: 2000
        currency: SGD
      description: null
      loyalty_program:
        uuid: 00000000-0000-0000-0000-000000000020
        name: Member wallet
        type: stored_value
      loyalty_program_type: stored_value
      loyalty_balance_uuid: 00000000-0000-0000-0000-000000000021
      operation_uuid: 00000000-0000-0000-0000-000000000022
      customer_tier_achievement_uuid: null
      created_at: 2026-10-27T00:00:00Z
  created_at: 2026-10-27T00:00:00Z
