# List virtual currency transactions

> Returns the virtual currency transaction history for a profile, newest first. Results use cursor pagination: when the response includes a non-null `pagination.next_cursor`, pass it back as the `cursor` query parameter to fetch the next page.

## OpenAPI

```yaml
/api-specs/adapty-api.yaml get /api/v2/server-side-api/vc/transactions/
openapi: 3.1.0
info:
  title: Adapty server-side API
  version: 1.0.0
servers:
  - url: https://api.adapty.io
    description: Production server
paths:
  /api/v2/server-side-api/vc/transactions/:
    get:
      summary: List virtual currency transactions
      description: |
        Returns the virtual currency transaction history for a profile, newest first. Results use cursor pagination: when the response includes a non-null `pagination.next_cursor`, pass it back as the `cursor` query parameter to fetch the next page.
      operationId: listVirtualCurrencyTransactions
      tags:
        - Virtual Currency
      security:
        - apikeyAuth: []
      parameters:
        - name: adapty-customer-user-id
          in: header
          required: false
          schema:
            type: string
          description: The unique ID of the customer in your system. Either `adapty-customer-user-id` or `adapty-profile-id` is required.
        - name: adapty-profile-id
          in: header
          required: false
          schema:
            type: string
          description: The unique ID of the profile in your system. Your best option if you are working with anonymous profiles. Either `adapty-customer-user-id` or `adapty-profile-id` is required.
        - name: currency_code
          in: query
          required: false
          schema:
            type: string
          description: Filter the history to a single virtual currency code.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque pagination cursor returned as `pagination.next_cursor` in a previous response. Omit to fetch the first page.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 100
          description: Maximum number of transactions to return per page. Defaults to 50.
      responses:
        "200":
          description: Transaction history returned successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VirtualCurrencyTransactionsHistoryResponse"
              example:
                data:
                  - transaction_id: 0190e8a4-1c2b-7def-8abc-2c1a4b6d8e90
                    transaction_type: api_transaction
                    items:
                      - currency_code: COINS
                        amount: 500
                        balance_after: 12950
                    metadata:
                      reason: promo_bonus
                    created_at: "2026-05-23T10:30:00Z"
                  - transaction_id: 0190e7b2-9a44-7c10-bb31-7d2e9f0a1c55
                    transaction_type: store_purchase
                    items:
                      - currency_code: COINS
                        amount: 1000
                        balance_after: 12450
                    created_at: "2026-05-22T18:05:12Z"
                  - transaction_id: 0190e5c0-3f18-7b9a-9e6d-44a1c8b27e03
                    transaction_type: subscription_renewal
                    items:
                      - currency_code: GEMS
                        amount: 200
                        balance_after: 3280
                    created_at: "2026-05-20T09:00:00Z"
                pagination:
                  next_cursor: MjAyNi0wNS0yMFQwOTowMDowMFowMTkwZTVjMC0zZjE4LTdiOWEtOWU2ZC00NGExYzhiMjdlMDM=
        "400":
          description: Bad request. The `cursor` value is invalid (`error_code` is `invalid_cursor`).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: Unauthorized. The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: Forbidden. The Server API for virtual currencies is not enabled for this app.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: Profile not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: Internal server error
components:
  schemas:
    VirtualCurrencyTransactionsHistoryResponse:
      type: object
      description: Paginated list of virtual currency transactions for a profile.
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/VirtualCurrencyTransactionsHistoryItem"
        pagination:
          $ref: "#/components/schemas/VirtualCurrencyHistoryPagination"
      required:
        - data
        - pagination
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
                nullable: true
                description: Source of the error
              errors:
                type: array
                items:
                  type: string
                description: Array of error messages
        error_code:
          type: string
          description: Short error name
        status_code:
          type: integer
          description: HTTP status code
      required:
        - errors
        - error_code
        - status_code
    VirtualCurrencyTransactionsHistoryItem:
      type: object
      properties:
        transaction_id:
          type: string
          format: uuid
          description: Unique ID of the transaction.
        transaction_type:
          type: string
          description: |
            The source of the transaction. One of `store_purchase`, `subscription_renewal`, `trial_start`, `api_transaction`, `dashboard_transaction`, `refund`, or `expiry`.
        items:
          type: array
          description: Per-currency balance changes recorded in this transaction.
          items:
            $ref: "#/components/schemas/VirtualCurrencyBalanceChange"
        metadata:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Key-value pairs stored with the transaction, if any.
        created_at:
          type: string
          format: date-time
          description: When the transaction was recorded.
      required:
        - transaction_id
        - transaction_type
        - items
        - created_at
    VirtualCurrencyHistoryPagination:
      type: object
      properties:
        next_cursor:
          type: string
          nullable: true
          description: |
            Opaque cursor for the next page. Pass it as the `cursor` query parameter to fetch more results. Null when there are no more pages.
      required:
        - next_cursor
    VirtualCurrencyBalanceChange:
      type: object
      properties:
        currency_code:
          type: string
          description: The virtual currency code.
        amount:
          type: integer
          format: int32
          description: The signed change applied to the balance. A positive value is a credit, a negative value is a debit.
        balance_after:
          type: integer
          format: int32
          minimum: 0
          description: The currency balance after this transaction was applied.
      required:
        - currency_code
        - amount
        - balance_after
  securitySchemes:
    apikeyAuth:
      type: apiKey
      name: Authorization
      in: header
      default: Api-Key {Your secret API key}
      description: |
        API requests must be authenticated by your secret API key as the **Authorization** 
        header with the value `Api-Key {your_secret_api_key}`, for example, 
        `Api-Key secret_live_...`. Find this key in the Adapty Dashboard -> 
        **App Settings** -> **General** tab -> **API keys** section.
```
