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

# Record a ticket purchase from external partner

> 
Record a ticket purchase where the partner handled payment externally
(e.g. on their own Stripe/PayPal) and Tickify mints the tickets.

**Request shape matches /tickets/purchase** — no prices, no buyer email,
no order id. The buyer is the authenticated partner user (JWT access token),
and pricing is resolved server-side via the quote logic.

**Flow:**
1. Partner sells ticket on their platform
2. Partner calls this endpoint with { eventKey, items, ... }
3. Tickify creates tickets, mints NFTs, delivers to the partner user's wallet/claim flow
4. Financial transaction recorded with historical fee snapshot
5. Webhook sent to partner (`purchase.completed`)

**Required fields:**
- `eventKey`: Tickify event ID
- `items[]`: Array of { tierKey, quantity } — prices resolved server-side
- `couponCode`, `upsellKeys`, `affiliateKey`, `waiverAccepted`: Same semantics as /tickets/purchase
- `currency`: ISO 4217 (default: USD)
    



## OpenAPI

````yaml /partner-docs/openapi.json post /partners/purchases
openapi: 3.0.0
info:
  title: Tickify Partner API
  description: >2-

        API documentation for the Tickify Partner Platform.

        Getting Started:
    1. Register as a partner and wait for approval from the Tickify team.
        2. Once approved, request an API key from the Tickify team. A Tickify admin will generate and securely share your API key with you.
        3. Use your API key to authenticate partner API requests.
        4. Generate an access token using the /partner/auth/token endpoint in the Auth documentation.
        5. Use the access token for authenticated requests where required.

        **API Keys:**
    - Test keys use the 

    `tk_test_` prefix. These keys work in sandbox mode and never charge real
    payment methods.

    - Live keys use the 

    `tk_live_` prefix. These keys process real payments and require completed
    Stripe Connect onboarding.

    - Both key types follow the same API behavior — only the payment environment
    differs.

    - To test checkout flows without real charges, use 

    `tk_test_` keys and include test card numbers in your Stripe integration.
        
  version: '1.0'
  contact: {}
servers:
  - url: http://localhost:3000
    description: Local Development
  - url: https://api-staging.tickify.io
    description: Staging
  - url: https://api.tickify.io
    description: Production
security: []
tags: []
paths:
  /partners/purchases:
    post:
      tags:
        - Partner Purchases
      summary: Record a ticket purchase from external partner
      description: >-

        Record a ticket purchase where the partner handled payment externally

        (e.g. on their own Stripe/PayPal) and Tickify mints the tickets.


        **Request shape matches /tickets/purchase** — no prices, no buyer email,

        no order id. The buyer is the authenticated partner user (JWT access
        token),

        and pricing is resolved server-side via the quote logic.


        **Flow:**

        1. Partner sells ticket on their platform

        2. Partner calls this endpoint with { eventKey, items, ... }

        3. Tickify creates tickets, mints NFTs, delivers to the partner user's
        wallet/claim flow

        4. Financial transaction recorded with historical fee snapshot

        5. Webhook sent to partner (`purchase.completed`)


        **Required fields:**

        - `eventKey`: Tickify event ID

        - `items[]`: Array of { tierKey, quantity } — prices resolved
        server-side

        - `couponCode`, `upsellKeys`, `affiliateKey`, `waiverAccepted`: Same
        semantics as /tickets/purchase

        - `currency`: ISO 4217 (default: USD)
            
      operationId: PartnerPurchasesController_recordPurchase
      parameters: []
      requestBody:
        required: true
        description: Purchase details
        content:
          application/json:
            schema:
              type: object
              required:
                - eventKey
                - items
              properties:
                eventKey:
                  type: string
                  example: 2c344fed-1642-404b-b572-a3fb53b0fac2
                  description: Tickify event ID
                items:
                  type: array
                  minItems: 1
                  items:
                    type: object
                    required:
                      - tierKey
                      - quantity
                    properties:
                      tierKey:
                        type: string
                        example: 550e8400-e29b-41d4-a716-446655440000
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 20
                        example: 2
                couponCode:
                  type: string
                  example: SUMMER24
                upsellKeys:
                  type: array
                  items:
                    type: string
                  example:
                    - up-123
                affiliateKey:
                  type: string
                  example: miles_test
                waiverAccepted:
                  type: boolean
                  example: true
                currency:
                  type: string
                  default: USD
                  example: USD
                metadata:
                  type: object
                  description: Custom metadata
      responses:
        '200':
          description: Purchase recorded successfully
        '201':
          description: Purchase recorded, tickets created
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderId:
                    type: string
                    example: sess_abc123
                  externalOrderId:
                    type: string
                    example: order_12345
                    description: Server-generated order reference
                  ticketsCreated:
                    type: number
                    example: 2
                  totalGross:
                    type: number
                    example: 599.98
                  totalFee:
                    type: number
                    example: 29.99
                  totalNet:
                    type: number
                    example: 569.99
        '400':
          description: Invalid input or event not found
        '401':
          description: Invalid or missing partner API key
        '403':
          description: Event does not belong to partner
        '422':
          description: Validation failed or event not found
      security:
        - access-token: []
        - partner-api-key: []
components:
  securitySchemes:
    access-token:
      scheme: bearer
      bearerFormat: JWT
      type: http
    partner-api-key:
      type: apiKey
      in: header
      name: x-partner-key
      description: Partner API Key (tk_live_... or tk_test_...)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.