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

# Get purchases for a customer

> Retrieves all purchases for a specific customer. Useful for billing history and access checks.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/sdk/purchases/customer/{customerRef}
openapi: 3.0.0
info:
  contact: {}
  description: The SolvaPay REST API specification
  title: SolvaPay REST API
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /v1/sdk/purchases/customer/{customerRef}:
    get:
      tags:
        - Purchases
      summary: Get purchases for a customer
      description: >-
        Retrieves all purchases for a specific customer. Useful for billing
        history and access checks.
      operationId: PurchaseSdkController_getPurchasesForCustomer
      parameters:
        - description: Customer reference or ID
          in: path
          name: customerRef
          required: true
          schema:
            example: cus_3C4D5E6F
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  purchases:
                    items:
                      $ref: '#/components/schemas/SdkPurchaseResponse'
                    type: array
          description: Customer purchases retrieved successfully
        '404':
          description: Customer not found
      security:
        - bearer: []
components:
  schemas:
    SdkPurchaseResponse:
      properties:
        amount:
          description: Amount in USD cents (normalised for aggregation)
          example: 9900
          type: number
        autoRenew:
          description: Auto-renew enabled
          type: boolean
        billingCycle:
          description: Billing cycle
          enum:
            - weekly
            - monthly
            - quarterly
            - yearly
          type: string
        cancellationReason:
          description: Cancellation reason
          type: string
        cancelledAt:
          description: Cancelled at
          type: string
        createdAt:
          description: Created at
          type: string
        currency:
          description: Original payment currency code
          example: GBP
          type: string
        customerEmail:
          description: Customer email
          example: customer@example.com
          type: string
        customerRef:
          description: Customer reference
          example: cus_3C4D5E6F
          type: string
        endDate:
          description: End date
          type: string
        exchangeRate:
          description: Exchange rate from original currency to USD
          example: 1.3082
          type: number
        isRecurring:
          description: Is recurring
          example: true
          type: boolean
        metadata:
          additionalProperties: true
          description: Arbitrary metadata attached to the purchase
          type: object
        nextBillingDate:
          description: Next billing date
          type: string
        originalAmount:
          description: Original amount in the payment currency (cents/pence)
          example: 10000
          type: number
        paidAt:
          description: Paid at timestamp
          type: string
        planSnapshot:
          allOf:
            - $ref: '#/components/schemas/SdkPlanSnapshotDto'
          description: Plan snapshot at time of purchase (null for credit topups)
        productName:
          description: Product name
          example: API Gateway Manager
          type: string
        productRef:
          description: Product reference
          example: prd_1A2B3C4D
          type: string
        reference:
          description: Purchase reference
          example: pur_1A2B3C4D
          type: string
        startDate:
          description: Start date
          type: string
        status:
          description: Purchase status
          example: active
          type: string
        usage:
          allOf:
            - $ref: '#/components/schemas/UsageBillingDto'
          description: Usage billing state for usage-based plans
      required:
        - reference
        - customerRef
        - customerEmail
        - productRef
        - status
        - amount
        - currency
        - startDate
        - isRecurring
        - createdAt
      type: object
    SdkPlanSnapshotDto:
      properties:
        billingCycle:
          description: Billing cycle
          example: monthly
          nullable: true
          type: string
        creditsPerUnit:
          description: Credits per usage unit (integer, >= 1)
          example: 1
          type: number
        currency:
          description: Currency code
          example: USD
          type: string
        features:
          additionalProperties: true
          description: Plan features
          nullable: true
          type: object
        freeUnits:
          description: Number of free units included
          example: 100
          type: number
        limit:
          description: Usage limit for the meter
          example: 5000
          type: number
        limits:
          additionalProperties: true
          description: Usage limits
          nullable: true
          type: object
        meterRef:
          description: Meter reference
          example: mtr_1A2B3C4D
          type: string
        name:
          description: Plan name captured at purchase time
          example: Pro Monthly
          type: string
        planType:
          description: Plan type
          example: recurring
          type: string
        price:
          description: Plan price in cents
          example: 2999
          type: number
        reference:
          description: Plan reference
          example: pln_1A2B3C4D
          type: string
      required:
        - price
        - currency
        - planType
      type: object
    UsageBillingDto:
      properties:
        overageCost:
          description: Overage cost in cents
          example: 0
          type: number
        overageUnits:
          description: Units exceeding the plan limit
          example: 0
          type: number
        periodEnd:
          description: Period end date
          example: '2025-11-01T00:00:00Z'
          type: string
        periodStart:
          description: Period start date
          example: '2025-10-01T00:00:00Z'
          type: string
        used:
          description: Units consumed in current period
          example: 150
          type: number
      required:
        - used
        - overageUnits
        - overageCost
      type: object

````