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

# Get Purchase

> Get details of an individual purchase



## OpenAPI

````yaml get /purchases/{purchase_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /purchases/{purchase_id}:
    get:
      tags:
        - purchases
      summary: Get Purchase
      description: Get details of an individual purchase
      operationId: get_purchase_purchases__purchase_id__get
      parameters:
        - name: purchase_id
          in: path
          required: true
          schema:
            type: string
            title: Purchase Id
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
            description: The client's API key secret value
            title: X-Api-Key
          description: The client's API key secret value
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPurchaseResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    GetPurchaseResponse:
      properties:
        purchase_id:
          type: string
          title: Purchase Id
          description: The unique identifier for the purchase
          examples:
            - 01J51S0JYV6N7K1030CV1ZKSCF
        date:
          type: string
          title: Date
          description: The date and time of the purchase
          examples:
            - '2024-01-01T00:00:00Z'
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
          description: The total amount of the purchase
          examples:
            - '9.34'
        tax:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Tax
          description: The tax amount of the purchase
          examples:
            - '0.85'
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
          description: The subtotal amount of the purchase
          examples:
            - '8.49'
        item_count:
          type: integer
          title: Item Count
          description: The number of items in the purchase
          examples:
            - 1
        items:
          items:
            $ref: '#/components/schemas/ItemResponse'
          type: array
          title: Items
          description: The list of items in the purchase
          examples:
            - - item_id: 01J51S0JYV6N7K1030CV1ZKSCA
                price: '8.49'
                product:
                  brand: diet-coke
                  description: Diet Coke - 12pk/12oz cans
                  name: Diet Coke 12pk
                  product_id: 01J51S0JYV6N7K1030CV1ZKSCB
                  upc: '049000028911'
                quantity: 1
      type: object
      required:
        - purchase_id
        - date
        - total
        - tax
        - subtotal
        - item_count
        - items
      title: GetPurchaseResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ItemResponse:
      properties:
        item_id:
          type: string
          title: Item Id
          description: The unique identifier for the item
          examples:
            - 01J51S0JYV6N7K1030CV1ZKSCA
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
          description: The price of the item
          examples:
            - '8.49'
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          description: The purchased quantity of the item
          examples:
            - 1
        product:
          $ref: '#/components/schemas/ItemProduct'
          description: The product of the item
          examples:
            - brand: diet-coke
              description: Diet Coke - 12pk/12oz cans
              name: Diet Coke 12pk
              product_id: 01J51S0JYV6N7K1030CV1ZKSCA
              upc: '049000028911'
      type: object
      required:
        - item_id
        - price
        - quantity
        - product
      title: ItemResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ItemProduct:
      properties:
        product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Id
          description: >-
            The unique identifier for the product, or null if the writer could
            not resolve the item to a catalog product
          examples:
            - 01J51S0JYV6N7K1030CV1ZKSCA
        brand:
          anyOf:
            - type: string
            - type: 'null'
          title: Brand
          description: The brand of the product
          examples:
            - diet-coke
        description:
          type: string
          title: Description
          description: The description of the product
          examples:
            - Diet Coke - 12pk/12oz cans
        name:
          type: string
          title: Name
          description: The name of the product
          examples:
            - Diet Coke 12pk
        upc:
          anyOf:
            - type: string
            - type: 'null'
          title: Upc
          description: The universal identifier for the product (UPC)
          readOnly: true
          examples:
            - '049000028911'
      type: object
      required:
        - description
        - name
        - upc
      title: ItemProduct
  securitySchemes:
    HTTPBearer:
      type: http
      description: A connection-specific token with access scope
      scheme: bearer

````