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

# Get Purchase



## OpenAPI

````yaml https://app.flowglad.com/api/openapi get /api/v1/purchases/{id}
openapi: 3.1.0
info:
  title: Flowglad API
  version: 0.0.1
servers:
  - url: https://app.flowglad.com
security: []
externalDocs:
  url: https://docs.flowglad.com
paths:
  /api/v1/purchases/{id}:
    get:
      tags:
        - Purchases
      summary: Get Purchase
      operationId: purchases-get
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  purchase:
                    $ref: '#/components/schemas/PurchaseRecord'
                    description: >-
                      A purchase record, which describes a transaction that can
                      be associated with either a subscription or single payment
                      price. Each purchase has a specific type that determines
                      its behavior and required fields.
                required:
                  - purchase
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PurchaseRecord:
      anyOf:
        - $ref: '#/components/schemas/SubscriptionPurchaseClientSelectSchema'
        - $ref: '#/components/schemas/SinglePaymentPurchaseClientSelectSchema'
        - $ref: '#/components/schemas/UsagePurchaseClientSelectSchema'
    error.BAD_REQUEST:
      title: Invalid input data error (400)
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Invalid input data
          type: string
        code:
          description: The error code
          example: BAD_REQUEST
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.UNAUTHORIZED:
      title: Authorization not provided error (401)
      description: The error information
      example:
        code: UNAUTHORIZED
        message: Authorization not provided
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Authorization not provided
          type: string
        code:
          description: The error code
          example: UNAUTHORIZED
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.FORBIDDEN:
      title: Insufficient access error (403)
      description: The error information
      example:
        code: FORBIDDEN
        message: Insufficient access
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Insufficient access
          type: string
        code:
          description: The error code
          example: FORBIDDEN
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.NOT_FOUND:
      title: Not found error (404)
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Not found
          type: string
        code:
          description: The error code
          example: NOT_FOUND
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    error.INTERNAL_SERVER_ERROR:
      title: Internal server error error (500)
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
      type: object
      properties:
        message:
          description: The error message
          example: Internal server error
          type: string
        code:
          description: The error code
          example: INTERNAL_SERVER_ERROR
          type: string
        issues:
          description: An array of issues that were responsible for the error
          example: []
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
            additionalProperties: false
      required:
        - message
        - code
      additionalProperties: false
    SubscriptionPurchaseClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        name:
          type: string
        status:
          type: string
          enum:
            - open
            - pending
            - failed
            - paid
            - refunded
            - partial_refund
            - fraudulent
        customerId:
          type: string
        organizationId:
          type: string
        billingCycleAnchor:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        priceId:
          type: string
        quantity:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        priceType:
          type: string
          const: subscription
        trialPeriodDays:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        pricePerBillingCycle:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        intervalUnit:
          type: string
          enum:
            - day
            - week
            - month
            - year
        intervalCount:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        firstInvoiceValue:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        totalPurchaseValue:
          description: Omitted.
          type: 'null'
        bankPaymentOnly:
          anyOf:
            - type: boolean
            - type: 'null'
        purchaseDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        endDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        proposal:
          anyOf:
            - type: string
            - type: 'null'
        archived:
          anyOf:
            - type: boolean
            - type: 'null'
        billingAddress:
          anyOf:
            - $ref: '#/components/schemas/BillingAddress'
            - type: 'null'
        metadata:
          anyOf:
            - $ref: '#/components/schemas/Metadata'
            - type: 'null'
        pricingModelId:
          type: string
        position:
          type: number
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - name
        - status
        - customerId
        - organizationId
        - priceId
        - quantity
        - priceType
        - trialPeriodDays
        - pricePerBillingCycle
        - intervalUnit
        - intervalCount
        - firstInvoiceValue
        - totalPurchaseValue
        - bankPaymentOnly
        - proposal
        - archived
        - pricingModelId
        - position
      additionalProperties: false
    SinglePaymentPurchaseClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        name:
          type: string
        status:
          type: string
          enum:
            - open
            - pending
            - failed
            - paid
            - refunded
            - partial_refund
            - fraudulent
        customerId:
          type: string
        organizationId:
          type: string
        billingCycleAnchor:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        priceId:
          type: string
        quantity:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        priceType:
          type: string
          const: single_payment
        trialPeriodDays:
          description: Omitted.
          type: 'null'
        pricePerBillingCycle:
          description: Omitted.
          type: 'null'
        intervalUnit:
          description: Omitted.
          type: 'null'
        intervalCount:
          description: Omitted.
          type: 'null'
        firstInvoiceValue:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        totalPurchaseValue:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        bankPaymentOnly:
          anyOf:
            - type: boolean
            - type: 'null'
        purchaseDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        endDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        proposal:
          anyOf:
            - type: string
            - type: 'null'
        archived:
          anyOf:
            - type: boolean
            - type: 'null'
        billingAddress:
          anyOf:
            - $ref: '#/components/schemas/BillingAddress'
            - type: 'null'
        metadata:
          anyOf:
            - $ref: '#/components/schemas/Metadata'
            - type: 'null'
        pricingModelId:
          type: string
        position:
          type: number
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - name
        - status
        - customerId
        - organizationId
        - priceId
        - quantity
        - priceType
        - trialPeriodDays
        - pricePerBillingCycle
        - intervalUnit
        - intervalCount
        - firstInvoiceValue
        - totalPurchaseValue
        - bankPaymentOnly
        - proposal
        - archived
        - pricingModelId
        - position
      additionalProperties: false
    UsagePurchaseClientSelectSchema:
      type: object
      properties:
        id:
          type: string
        createdAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updatedAt:
          description: Epoch milliseconds.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        livemode:
          type: boolean
        name:
          type: string
        status:
          type: string
          enum:
            - open
            - pending
            - failed
            - paid
            - refunded
            - partial_refund
            - fraudulent
        customerId:
          type: string
        organizationId:
          type: string
        billingCycleAnchor:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        priceId:
          type: string
        quantity:
          description: A positive integer
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        priceType:
          type: string
          const: usage
        trialPeriodDays:
          description: Omitted.
          type: 'null'
        pricePerBillingCycle:
          description: Omitted.
          type: 'null'
        intervalUnit:
          description: Omitted.
          type: 'null'
        intervalCount:
          description: Omitted.
          type: 'null'
        firstInvoiceValue:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        totalPurchaseValue:
          anyOf:
            - description: A positive integer
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            - type: number
              const: 0
        bankPaymentOnly:
          anyOf:
            - type: boolean
            - type: 'null'
        purchaseDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        endDate:
          anyOf:
            - description: Epoch milliseconds.
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        proposal:
          anyOf:
            - type: string
            - type: 'null'
        archived:
          anyOf:
            - type: boolean
            - type: 'null'
        billingAddress:
          anyOf:
            - $ref: '#/components/schemas/BillingAddress'
            - type: 'null'
        metadata:
          anyOf:
            - $ref: '#/components/schemas/Metadata'
            - type: 'null'
        pricingModelId:
          type: string
        position:
          type: number
      required:
        - id
        - createdAt
        - updatedAt
        - livemode
        - name
        - status
        - customerId
        - organizationId
        - priceId
        - quantity
        - priceType
        - trialPeriodDays
        - pricePerBillingCycle
        - intervalUnit
        - intervalCount
        - firstInvoiceValue
        - totalPurchaseValue
        - bankPaymentOnly
        - proposal
        - archived
        - pricingModelId
        - position
      additionalProperties: false
    BillingAddress:
      type: object
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
        firstName:
          anyOf:
            - type: string
            - type: 'null'
        lastName:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - type: string
              format: email
              pattern: >-
                ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
            - type: 'null'
        address:
          type: object
          properties:
            name:
              anyOf:
                - type: string
                - type: 'null'
            line1:
              anyOf:
                - type: string
                - type: 'null'
            line2:
              anyOf:
                - type: string
                - type: 'null'
            city:
              anyOf:
                - type: string
                - type: 'null'
            state:
              anyOf:
                - type: string
                - type: 'null'
            postal_code:
              anyOf:
                - type: string
                - type: 'null'
            country:
              type: string
          required:
            - country
          additionalProperties: false
        phone:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - address
      additionalProperties: false
    Metadata:
      description: JSON object
      type: object
      propertyNames:
        type: string
      additionalProperties:
        anyOf:
          - type: string
            maxLength: 500
          - type: number
          - type: boolean
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````