> ## 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.

# Validate Purchase Code

> Validates a purchase verification code and returns purchase details including available prices.



## OpenAPI

````yaml /openapi/client.json post /payments/purchases/validate-code
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/validate-code:
    post:
      tags:
        - Payments
      summary: Validate Purchase Code
      description: >-
        Validates a purchase verification code and returns purchase details
        including available prices.
      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
                return_url:
                  type: string
                  example: https://myapp.com/purchase-success
                  description: URL to redirect to after purchase completion
              required:
                - full_code
              example:
                full_code: proj_abc123_def456ghi789
                return_url: https://myapp.com/purchase-success
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  product:
                    type: object
                    properties:
                      display_name:
                        type: string
                      customer_type:
                        type: string
                        enum:
                          - user
                          - team
                          - custom
                      free_trial:
                        type: array
                        items:
                          type: integer
                      server_only:
                        type: boolean
                        default: true
                      stackable:
                        type: boolean
                        default: false
                      prices:
                        type: object
                        properties: {}
                        required: []
                      included_items:
                        type: object
                        properties: {}
                        required: []
                      client_metadata:
                        type: object
                        example:
                          featureFlag: true
                          source: marketing-campaign
                        description: >-
                          Client metadata. Used as a data store, accessible from
                          the client side. Do not store information that should
                          not be exposed to the client.
                      client_read_only_metadata:
                        type: object
                        example:
                          featureFlag: true
                          source: marketing-campaign
                        description: >-
                          Client read-only, server-writable metadata. Used as a
                          data store, accessible from the client side. Do not
                          store information that should not be exposed to the
                          client. The client can read this data, but cannot
                          modify it. This is useful for things like subscription
                          status.
                      server_metadata:
                        type: object
                        example:
                          featureFlag: true
                          source: marketing-campaign
                        description: >-
                          Server metadata. Used as a data store, only accessible
                          from the server side. You can store secret information
                          related to the product here.
                    required:
                      - display_name
                      - customer_type
                  stripe_account_id:
                    type: string
                  project_id:
                    type: string
                  project_logo_url:
                    type: string
                  already_bought_non_stackable:
                    type: boolean
                  conflicting_products:
                    type: array
                    items:
                      type: object
                      properties:
                        product_id:
                          type: string
                        display_name:
                          type: string
                      required:
                        - product_id
                        - display_name
                  test_mode:
                    type: boolean
                  charges_enabled:
                    type: boolean
                required:
                  - project_id
                  - already_bought_non_stackable
                  - conflicting_products
                  - test_mode

````