> ## 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 checkout session

> Initializes a new Blink checkout session and provides the checkout URL.

- **Request Headers:**
  - `x-store-id` (string, required): The ID of the store creating the checkout.

- **Request Body:**
  - `product_id` (string, required): Identifier of the product to checkout.
  - `variant_id` (string, optional): Variant identifier if applicable.
  - `customer_email` (string, optional): Customer's email address.
  - ... (other checkout configurations)

- **Response:** A Blink checkout session object including the checkout URL.

Facilitates smooth customer transactions with Blink for easy payment processing.



## OpenAPI

````yaml /api-reference/blink-api.json 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:
  - storeIdHeader: []
tags:
  - name: Invoices
    description: Unified merchant of record invoices for products and subscriptions.
  - name: Geo Pricing
    description: Resolve Purchasing Power Parity (PPP) localized pricing.
paths:
  /checkouts:
    post:
      tags:
        - Checkouts
      summary: Create a checkout session
      description: >-
        Initializes a new Blink checkout session and provides the checkout URL.


        - **Request Headers:**
          - `x-store-id` (string, required): The ID of the store creating the checkout.

        - **Request Body:**
          - `product_id` (string, required): Identifier of the product to checkout.
          - `variant_id` (string, optional): Variant identifier if applicable.
          - `customer_email` (string, optional): Customer's email address.
          - ... (other checkout configurations)

        - **Response:** A Blink checkout session object including the checkout
        URL.


        Facilitates smooth customer transactions with Blink for easy payment
        processing.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCheckoutSessionRequest'
      responses:
        '201':
          description: Checkout session created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionDetails'
      security:
        - storeIdHeader: []
components:
  schemas:
    CreateCheckoutSessionRequest:
      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: object
        success_url:
          type: string
        cancel_url:
          type: string
        metadata:
          type: object
        options:
          type: object
          description: Customization options for the checkout layout and behavior.
          properties:
            layout:
              type: string
              enum:
                - classic
                - overlay
                - inline
                - split
                - minimal
              description: >-
                The layout style of the checkout page. Supports 'classic',
                'showcase', 'split', or 'minimal'.
            hide_carousel:
              type: boolean
              description: Hide the product image carousel.
            hide_title:
              type: boolean
              description: Hide the product title.
            hide_discount:
              type: boolean
              description: Hide the discount code input.
            hide_refund:
              type: boolean
              description: Hide the refund policy text.
            hide_support:
              type: boolean
              description: Hide the support contact email.
            show_desc:
              type: boolean
              description: Show the full product description.
            button_text:
              type: string
              description: Custom text for the checkout button.
            locale:
              type: string
              description: The language locale for the checkout.
            product_name:
              type: string
              description: Override the product name displayed on the checkout.
            custom_fields:
              type: array
              description: An array of custom fields to collect from the buyer.
              items:
                type: object
                additionalProperties: true
        appearance:
          type: object
          description: Appearance overrides for custom checkouts.
          properties:
            theme:
              type: string
              enum:
                - light
                - dark
                - system
            variables:
              type: object
              properties:
                colorPrimary:
                  type: string
      required:
        - product_id
    CheckoutSessionDetails:
      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
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````