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

# Transaction History

> Get transaction history for a subscriber

<Info>
  Returns paginated transaction history. Requires PIN verification for security.
</Info>

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_live_xxx` or `Bearer eyJ...` (JWT)
</ParamField>

### Path Parameters

<ParamField path="subscriber_id" type="string" required>
  Subscriber UUID
</ParamField>

### Body Parameters

<ParamField body="pin" type="string" required>
  Subscriber's 4-digit PIN
</ParamField>

<ParamField body="limit" type="integer" default="20">
  Results per page (max 100)
</ParamField>

<ParamField body="offset" type="integer" default="0">
  Pagination offset
</ParamField>

***

## Response

<ResponseField name="transactions" type="array">
  Array of transaction objects
</ResponseField>

<ResponseField name="total_count" type="integer">
  Total transactions
</ResponseField>

<ResponseField name="limit" type="integer">
  Current page size
</ResponseField>

<ResponseField name="offset" type="integer">
  Current offset
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://demo.api.vultlocal.com/api/v1/wallet/transactions/sub_abc123" \
    -H "Authorization: Bearer olive_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "pin": "1234",
      "limit": 20,
      "offset": 0
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "transactions": [
      {
        "id": "txn_abc123",
        "type": "transfer_p2p",
        "status": "completed",
        "amount": 5000000,
        "amount_formatted": "50,000.00 SLE",
        "fee": 75000,
        "direction": "debit",
        "counterparty": {
          "name": "Jane Smith",
          "card_serial": "OLIV0002"
        },
        "balance_after": 7500000,
        "memo": "Payment for services",
        "created_at": "2025-01-15T10:30:00Z"
      },
      {
        "id": "txn_def456",
        "type": "agent_cashin",
        "status": "completed",
        "amount": 10000000,
        "amount_formatted": "100,000.00 SLE",
        "fee": 0,
        "direction": "credit",
        "counterparty": {
          "name": "Agent ABC",
          "type": "agent"
        },
        "balance_after": 12500000,
        "created_at": "2025-01-14T15:00:00Z"
      }
    ],
    "total_count": 45,
    "limit": 20,
    "offset": 0
  }
  ```
</ResponseExample>

***

## Transaction Fields

| Field           | Description                                  |
| --------------- | -------------------------------------------- |
| `type`          | Transaction type (see overview)              |
| `status`        | `completed`, `pending`, `failed`, `reversed` |
| `direction`     | `credit` (incoming) or `debit` (outgoing)    |
| `counterparty`  | Other party details                          |
| `balance_after` | Balance after transaction                    |

***

## Errors

| Status | Code                   | Description             |
| ------ | ---------------------- | ----------------------- |
| 400    | `INVALID_PIN_FORMAT`   | PIN must be 4 digits    |
| 401    | `INVALID_PIN`          | PIN verification failed |
| 401    | `UNAUTHORIZED`         | Invalid API key         |
| 404    | `SUBSCRIBER_NOT_FOUND` | Subscriber not found    |
| 500    | `INTERNAL_ERROR`       | Server error            |


## OpenAPI

````yaml olive-openapi.json POST /wallet/transactions/{subscriber_id}
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /wallet/transactions/{subscriber_id}:
    post:
      tags:
        - Wallet
      summary: Get transaction history
      description: Get transaction history for a subscriber (requires PIN verification)
      parameters:
        - description: Subscriber ID
          name: subscriber_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handler.GetTransactionHistoryRequest'
        description: Transaction history request with PIN
        required: true
      responses:
        '200':
          description: Transaction history
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid request or PIN
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  schemas:
    handler.GetTransactionHistoryRequest:
      type: object
      required:
        - pin
      properties:
        limit:
          type: integer
          example: 20
        offset:
          type: integer
          example: 0
        pin:
          type: string
          example: '1234'
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````