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

# Create payment checkout session

> Creates a Stripe PaymentIntent on the organisation's connected account via direct charge. Revenue share is applied via application_fee_amount. Returns the client_secret for Stripe.js to confirm the payment on the hosted payment page.



## OpenAPI

````yaml /api-reference/openapi.json post /i/{token}/checkout-session
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /i/{token}/checkout-session:
    post:
      tags:
        - Payments
      summary: Create payment checkout session
      description: >-
        Creates a Stripe PaymentIntent on the organisation's connected account
        via direct charge. Revenue share is applied via application_fee_amount.
        Returns the client_secret for Stripe.js to confirm the payment on the
        hosted payment page.
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSessionResponse'
        '404':
          description: >-
            Payment.InvalidToken — the payment link is invalid or has expired


            Organisation.NotFound — the organisation does not exist or could not
            be resolved


            Client.NotFound — the client does not exist or is not visible to the
            caller
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: >-
            Payment.InvoiceNotPayable — the invoice is voided or already paid


            PaymentAccount.NotEnabled — organisation does not have a payment
            account; enable it first
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '502':
          description: >-
            Payment.ProviderError — Stripe returned an error while creating the
            payment intent
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    CheckoutSessionResponse:
      required:
        - clientSecret
        - publishableKey
        - connectedAccountId
        - currency
      type: object
      properties:
        clientSecret:
          type: string
        publishableKey:
          type: string
        connectedAccountId:
          type: string
        amount:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - number
            - string
          format: double
        currency:
          type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string

````