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

# Create Purchase Session

> Creates a purchase session for completing a purchase.



## OpenAPI

````yaml /openapi/client.json post /payments/purchases/purchase-session
openapi: 3.1.0
info:
  title: Hexclave REST API
  version: 1.0.0
  description: >-
    The Hexclave REST API. All request headers are documented as canonical
    `X-Hexclave-*`; the equivalent `X-Stack-*` aliases are accepted on every
    endpoint for backwards compatibility. Response headers
    `X-Hexclave-actual-status`, `X-Hexclave-known-error`, and
    `X-Hexclave-request-id` are emitted alongside their legacy `X-Stack-*`
    equivalents.
servers:
  - url: https://api.hexclave.com/api/v1
    description: Hexclave REST API
security: []
paths:
  /payments/purchases/purchase-session:
    post:
      tags:
        - Payments
      summary: Create Purchase Session
      description: Creates a purchase session for completing a purchase.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                full_code:
                  type: string
                  example: proj_abc123_def456ghi789
                  description: >-
                    The verification code, given as a query parameter in the
                    purchase URL
                price_id:
                  type: string
                  example: price_1234567890abcdef
                  description: The Stack auth price ID to purchase
                quantity:
                  type: integer
                  example: 1
                  description: The quantity to purchase
                  default: 1
              required:
                - full_code
                - price_id
              example:
                full_code: proj_abc123_def456ghi789
                price_id: price_1234567890abcdef
                quantity: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  client_secret:
                    type: string
                    example: 1234567890abcdef_secret_xyz123
                    description: >-
                      Stripe client secret used by the browser to confirm
                      payment via Stripe Elements. Omitted when no payment step
                      is required from the customer; in that case the purchase
                      is being settled without a confirmation step and the
                      caller should skip mounting Stripe Elements.

````