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

# Create Stripe Checkout Session (Tickify-hosted payment)

> 
Create a Stripe Checkout Session for an event you organise. Tickify collects
payment on its platform account and pays you out post-event via Transfer.

**Authentication:** Requires a valid Partner API Key (Bearer token).

**Requires:**
- Partner must have completed Stripe Connect onboarding (`stripeOnboardVerified: true`)

**Flow:**
1. (Optional) Call `POST /partners/events/quote` to show the buyer a price breakdown
2. Call this endpoint — prices are resolved server-side, exactly like /tickets/purchase
3. Redirect the buyer to `sessionUrl` (Stripe hosted checkout; Stripe collects the buyer's email)
4. Buyer completes payment
5. Stripe webhook fulfils tickets (PENDING → PAID), mints NFTs, records finance
6. Partner receives `purchase.completed` webhook

**Idempotency:** A server-generated order ID is returned as `externalOrderId`
in the response — pass it to support if you need reconciliation.

**Required fields:**
- `eventKey`: Tickify event ID
- `items[]`: { tierKey, quantity } — prices resolved server-side via quote
- `couponCode`, `upsellKeys`, `affiliateKey`, `waiverAccepted`, `platform`: Same semantics as /tickets/purchase
- `successUrl`: Redirect after successful payment
- `cancelUrl`: Redirect after cancelled payment
- `currency`: ISO 4217 (default: USD)
    



## OpenAPI

````yaml /partner-docs/openapi.json post /partners/checkout-session
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/checkout-session:
    post:
      tags:
        - Partner Purchases
      summary: Create Stripe Checkout Session (Tickify-hosted payment)
      description: >-

        Create a Stripe Checkout Session for an event you organise. Tickify
        collects

        payment on its platform account and pays you out post-event via
        Transfer.


        **Authentication:** Requires a valid Partner API Key (Bearer token).


        **Requires:**

        - Partner must have completed Stripe Connect onboarding
        (`stripeOnboardVerified: true`)


        **Flow:**

        1. (Optional) Call `POST /partners/events/quote` to show the buyer a
        price breakdown

        2. Call this endpoint — prices are resolved server-side, exactly like
        /tickets/purchase

        3. Redirect the buyer to `sessionUrl` (Stripe hosted checkout; Stripe
        collects the buyer's email)

        4. Buyer completes payment

        5. Stripe webhook fulfils tickets (PENDING → PAID), mints NFTs, records
        finance

        6. Partner receives `purchase.completed` webhook


        **Idempotency:** A server-generated order ID is returned as
        `externalOrderId`

        in the response — pass it to support if you need reconciliation.


        **Required fields:**

        - `eventKey`: Tickify event ID

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

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

        - `successUrl`: Redirect after successful payment

        - `cancelUrl`: Redirect after cancelled payment

        - `currency`: ISO 4217 (default: USD)
            
      operationId: PartnerPurchasesController_createCheckoutSession
      parameters: []
      requestBody:
        required: true
        description: Checkout session details
        content:
          application/json:
            schema:
              type: object
              required:
                - eventKey
                - items
                - successUrl
                - cancelUrl
              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
                platform:
                  type: string
                  enum:
                    - web
                    - app
                  default: web
                currency:
                  type: string
                  default: USD
                  example: USD
                metadata:
                  type: object
                successUrl:
                  type: string
                  format: uri
                  example: https://partner.com/success?session_id={CHECKOUT_SESSION_ID}
                cancelUrl:
                  type: string
                  format: uri
                  example: https://partner.com/cancel
      responses:
        '200':
          description: Checkout session created successfully
        '201':
          description: Checkout session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessionId:
                    example: cs_test_abc123
                    type: string
                  sessionUrl:
                    type: string
                    format: uri
                    example: https://checkout.stripe.com/pay/cs_test_abc123
                  externalOrderId:
                    type: string
                    example: order_12345
                    description: Server-generated order reference for reconciliation
                  quote:
                    type: object
                    description: Server-side price breakdown (same as /tickets/quote)
        '400':
          description: Invalid input or partner not onboarded
        '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.