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

# List purchases for a user

> Returns a paginated list of purchases for the specified user.
Purchases are ordered by purchase date (newest first).
Supports cursor-based pagination and optional platform filtering.




## OpenAPI

````yaml /api-reference/rest-api-v4.yaml get /users/{user_id}/purchases
openapi: 3.0.3
info:
  title: Qonversion REST API v4
  version: '4.0'
  description: >-
    Qonversion REST API v4 follows REST standards. It has predictable
    resource-oriented URLs, accepts JSON-encoded request bodies, returns
    JSON-encoded responses, and uses standard HTTP response codes,
    authentication, and verbs.
servers:
  - url: https://api.qonversion.io/v4
    description: Production
security:
  - secretAuth: []
tags:
  - name: Users
    description: Retrieve Qonversion users
  - name: User Properties
    description: Manage user-level attributes
  - name: Identities
    description: Link Qonversion users to your own auth IDs
  - name: Entitlements
    description: Entitlement definitions and user grants
  - name: Purchases
    description: A user's purchase history
  - name: Products
    description: Products configured in the Qonversion dashboard
  - name: Customers
    description: Aggregated customer records, properties, permissions, and metrics
  - name: Segments
    description: Dynamic and system segments of users
  - name: Experiments
    description: Paywall and offering A/B experiments
  - name: Screens
    description: No-code paywall screens — CRUD, publish, analytics
  - name: Analytics
    description: Charts, cards, cohorts, LTV, and insights
  - name: Exports
    description: Asynchronous data exports
  - name: Events
    description: Event catalog
  - name: Scheduled Reports
    description: Recurring reports delivered to external destinations
  - name: Integrations
    description: Third-party integrations configuration
  - name: Automations
    description: Event-driven automations
  - name: Project Settings
    description: Project-level configuration, secret, and store credentials
paths:
  /users/{user_id}/purchases:
    get:
      tags:
        - Purchases
      summary: List purchases for a user
      description: |
        Returns a paginated list of purchases for the specified user.
        Purchases are ordered by purchase date (newest first).
        Supports cursor-based pagination and optional platform filtering.
      operationId: v4ListUserPurchases
      parameters:
        - name: user_id
          in: path
          required: true
          description: The user identifier.
          schema:
            type: string
            maxLength: 256
          example: user_abc123
        - name: limit
          in: query
          description: Maximum number of purchases to return. Min 1, max 100.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - name: starting_after
          in: query
          description: >
            Cursor for pagination. Pass the `id` of the last purchase from the
            previous page to fetch the next page.
          required: false
          schema:
            type: string
        - name: filter[platform]
          in: query
          description: >
            Filter purchases by platform. Repeat the query parameter to match
            multiple platforms (OR logic). Example:
            `?filter[platform]=app_store&filter[platform]=stripe`.
          required: false
          explode: true
          schema:
            type: array
            maxItems: 3
            items:
              type: string
              x-extensible-enum:
                - app_store
                - play_store
                - stripe
      responses:
        '200':
          description: A paginated list of purchases.
          headers:
            Cache-Control:
              schema:
                type: string
                example: no-cache
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4PurchaseList'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '502':
          description: Storage error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
        '504':
          description: Upstream timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V4Error'
      security:
        - secretAuth: []
components:
  schemas:
    V4PurchaseList:
      type: object
      required:
        - object
        - url
        - data
        - has_more
      properties:
        object:
          type: string
          enum:
            - list
        url:
          type: string
          example: /v4/users/user_abc123/purchases
        data:
          type: array
          items:
            $ref: '#/components/schemas/V4Purchase'
        has_more:
          type: boolean
        next_cursor:
          type: string
          nullable: true
          description: >-
            ID to pass as `starting_after` on the next request. Present only
            when `has_more` is `true`; otherwise `null`.
      example:
        object: list
        url: /v4/users/user_abc123/purchases
        has_more: false
        next_cursor: null
        data:
          - object: purchase
            id: '12345'
            url: /v4/users/user_abc123/purchases/12345
            user_id: user_abc123
            platform: app_store
            product_id: com.example.monthly
            currency: USD
            price: '9.99'
            purchased_at: '2025-04-01T10:30:00Z'
            expires_at: '2025-05-01T10:30:00Z'
            is_auto_renewing: true
            store_data:
              transaction_id: '2000000123456789'
              original_transaction_id: '2000000123456789'
              product_id: com.example.monthly
            created_at: '2025-04-01T10:30:00Z'
    V4Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - request
                - resource
                - logical
                - internal
            code:
              type: string
              description: |
                Machine-readable snake_case error code. Examples include
                `invalid_data`, `invalid_request`, `invalid_product_id`,
                `not_found`, `already_exists`, `offering_already_exists`,
                `product_not_in_project`, `cannot_set_main_directly`,
                `cannot_demote_main`, `cannot_patch_experiment_variant`,
                `cannot_delete_experiment_variant`, and
                `cannot_setmain_experiment_variant`. Resource-specific codes
                are documented on the corresponding reference page.
            message:
              type: string
              description: Human-readable description. May change; do not parse.
            details:
              type: array
              nullable: true
              description: Per-field validation errors, present on 400 validation failures.
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
    V4Purchase:
      type: object
      required:
        - object
        - id
        - url
        - user_id
        - platform
        - product_id
        - currency
        - price
        - purchased_at
        - is_auto_renewing
        - store_data
        - created_at
      properties:
        object:
          type: string
          enum:
            - purchase
        id:
          type: string
          example: '12345'
        url:
          type: string
          example: /v4/users/user_abc123/purchases/12345
        user_id:
          type: string
          example: user_abc123
        platform:
          type: string
          description: >-
            Store that originated the transaction. Determines the shape of
            `store_data`.
          x-extensible-enum:
            - app_store
            - play_store
            - stripe
        product_id:
          type: string
          description: >-
            Qonversion product identifier. For Play Store subscriptions with a
            base plan, the value is `{product_id}:{base_plan_id}`.
        currency:
          type: string
          description: >-
            Three-letter ISO 4217 currency code. May be empty when the source
            transaction lacks currency (e.g. legacy imports).
          example: USD
        price:
          type: string
          description: >-
            Monetary amount as a decimal string. May be empty when the source
            transaction lacks a price.
          example: '9.99'
        purchased_at:
          type: string
          format: date-time
          description: Time the store reported the transaction (RFC 3339 / ISO 8601).
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Subscription expiry time, or `null` for non-expiring purchases and
            consumables.
        is_auto_renewing:
          type: boolean
          description: >-
            Whether the subscription is set to auto-renew. `false` for one-time
            purchases and cancelled subscriptions.
        store_data:
          description: >-
            Platform-specific identifiers. The `platform` field on the enclosing
            purchase selects which shape is returned: `app_store` →
            `V4PurchaseAppStoreData`, `play_store` → `V4PurchasePlayStoreData`,
            `stripe` → `V4PurchaseStripeStoreData`. A native OpenAPI
            `discriminator` is not declared because the selector lives on the
            parent object, not on `store_data` itself.
          oneOf:
            - $ref: '#/components/schemas/V4PurchaseAppStoreData'
            - $ref: '#/components/schemas/V4PurchasePlayStoreData'
            - $ref: '#/components/schemas/V4PurchaseStripeStoreData'
        created_at:
          type: string
          format: date-time
          description: >-
            Time Qonversion first recorded the purchase. For history imported
            from the store this currently mirrors `purchased_at`.
    V4PurchaseAppStoreData:
      type: object
      description: '`store_data` shape when `platform` is `app_store`.'
      required:
        - transaction_id
        - original_transaction_id
        - product_id
      properties:
        transaction_id:
          type: string
          description: App Store transaction identifier for this specific purchase.
          example: '2000000123456789'
        original_transaction_id:
          type: string
          description: App Store original transaction identifier (shared across renewals).
          example: '2000000123456789'
        product_id:
          type: string
          description: App Store product identifier.
          example: com.example.monthly
    V4PurchasePlayStoreData:
      type: object
      description: >-
        `store_data` shape when `platform` is `play_store`. For subscriptions
        with a base plan, the enclosing purchase's `product_id` is
        `{product_id}:{base_plan_id}` (e.g. `com.example.yearly:monthly-base`),
        while the `product_id` here stays the bare Google Play product id.
      required:
        - order_id
        - purchase_token
        - product_id
      properties:
        order_id:
          type: string
          description: Google Play order identifier.
          example: GPA.1234-5678-9012-34567
        purchase_token:
          type: string
          description: Google Play purchase token.
          example: abcdefg.AO-J1Ox...
        product_id:
          type: string
          description: Google Play product identifier.
          example: com.example.yearly
    V4PurchaseStripeStoreData:
      type: object
      description: '`store_data` shape when `platform` is `stripe`.'
      required:
        - subscription_id
        - product_id
      properties:
        subscription_id:
          type: string
          description: Stripe subscription identifier.
          example: sub_123e4567
        product_id:
          type: string
          description: Stripe product identifier.
          example: prod_123e4567
  securitySchemes:
    secretAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_…
      description: >-
        Bearer authentication using the project **Secret Key** (prefixed with
        `sk_`, or `test_sk_` for sandbox). All v4 public endpoints require the
        Secret Key — see [Authentication](/reference/v4/authentication). Never
        expose the Secret Key in client-side code.

````