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

# Create a new checkout session

> Initializes a new Blink checkout session for a product and returns the session URL. Can be customized with discounts, affiliate codes, and display preferences.

**Usage:** This endpoint is crucial for starting a payment flow and redirecting customers to a payment page.



## OpenAPI

````yaml post /checkouts
openapi: 3.0.0
info:
  title: Blink API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security: []
paths:
  /checkouts:
    post:
      tags:
        - Checkouts
      summary: Create a new checkout session
      description: >-
        Initializes a new Blink checkout session for a product and returns the
        session URL. Can be customized with discounts, affiliate codes, and
        display preferences.


        **Usage:** This endpoint is crucial for starting a payment flow and
        redirecting customers to a payment page.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutCreateRequest'
      responses:
        '201':
          description: Checkout session created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
components:
  schemas:
    CheckoutCreateRequest:
      type: object
      properties:
        product_id:
          type: string
        variant_id:
          type: string
        customer_email:
          type: string
        discount_code:
          type: string
        affiliate_code:
          type: string
        splits:
          type: array
          items:
            type: object
        success_url:
          type: string
        cancel_url:
          type: string
        ui_mode:
          type: string
        return_url:
          type: string
        metadata:
          type: object
        seat_quantity:
          type: integer
          description: Pre-filled seat quantity
        options:
          type: object
          properties:
            layout:
              type: string
              enum:
                - default
                - overlay
                - minimal
                - inline
            hide_carousel:
              type: boolean
            hide_title:
              type: boolean
            hide_discount:
              type: boolean
            hide_refund:
              type: boolean
            hide_support:
              type: boolean
            show_desc:
              type: boolean
            show_preview:
              type: boolean
            button_text:
              type: string
            locale:
              type: string
            product_name:
              type: string
            custom_fields:
              type: array
              items:
                type: object
        custom_checkout_id:
          type: string
          description: UUID of the custom checkout design
      required:
        - product_id
    CheckoutSessionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
            url:
              type: string
            status:
              type: string
            payment_status:
              type: string
            customer_email:
              type: string
            amount_total:
              type: integer
            currency:
              type: string
            product_id:
              type: string
            variant_id:
              type: string
            expires_at:
              type: string
              format: date-time
            created_at:
              type: string
              format: date-time

````