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

# Expire a checkout session

> Fails with `payment_in_progress` if an attempt is still being processed.



## OpenAPI

````yaml /checkout/openapi.yaml post /v1/checkout-sessions/{id}/expire
openapi: 3.1.0
info:
  title: Kalixo Checkout API
  version: '2026-10-01'
  summary: Payment orchestration API for Kalixo partners.
  description: >
    Kalixo Checkout lets partners collect payments from their shoppers through
    one

    provider-neutral API. Kalixo is merchant of record and handles payment

    processing, so partners never integrate a payment provider directly.


    - Amounts are integers in the currency's minor unit (EUR 49.99 = `4999`).

    - Server endpoints use a secret key (`kc_sk_test_...` or `kc_sk_live_...`).

    - Client endpoints are called by `Kalixo.js` with a publishable key and the
      checkout session's `client_secret`.
    - Every `POST` with a secret key requires an `Idempotency-Key` header.
  contact:
    name: Kalixo Checkout integrations
    email: integrations@kalixo.io
  license:
    name: Proprietary
    url: https://kalixo.io/legal
servers:
  - url: https://checkout.kalixo.io
    description: Live
  - url: https://sandbox.checkout.kalixo.io
    description: Sandbox (test keys only, connected to the provider test environment)
security:
  - secretKey: []
tags:
  - name: Checkout sessions
    description: >-
      Create a session with the amount to charge, then show it with Kalixo.js or
      the hosted checkout.
  - name: Payments
    description: Read payments and capture or cancel authorized payments.
  - name: Refunds
    description: Full and partial refunds of captured payments.
  - name: Payment links
    description: Kalixo-hosted payment links that survive provider switches.
  - name: Customers
    description: Customers and their stored payment methods for one-click checkout.
  - name: Disputes
    description: Chargebacks and information requests, plus evidence upload.
  - name: Events
    description: The event log behind webhooks.
  - name: Webhook endpoints
    description: Where Kalixo delivers signed events.
  - name: Reports
    description: CSV exports of transactions for reconciliation and partner invoicing.
  - name: Client
    description: Called by Kalixo.js and the hosted checkout. Not for partner servers.
paths:
  /v1/checkout-sessions/{id}/expire:
    parameters:
      - $ref: '#/components/parameters/PathId'
    post:
      tags:
        - Checkout sessions
      summary: Expire a checkout session
      description: Fails with `payment_in_progress` if an attempt is still being processed.
      operationId: expireCheckoutSession
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '200':
          description: The expired checkout session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutSession'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    PathId:
      name: id
      in: path
      required: true
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: Unique key per logical request, reused on retries. 1 to 255 characters.
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    CheckoutSession:
      type: object
      required:
        - id
        - object
        - status
        - payment
        - amount
        - currency
        - country
        - reference
        - capture_method
        - return_url
        - url
        - expires_at
        - created_at
        - livemode
        - metadata
      properties:
        id:
          type: string
          examples:
            - cs_01JABCDEF
        object:
          type: string
          const: checkout_session
        status:
          $ref: '#/components/schemas/CheckoutSessionStatus'
        payment:
          type: string
          description: ID of the payment created with this session.
        amount:
          $ref: '#/components/schemas/Amount'
        currency:
          $ref: '#/components/schemas/Currency'
        country:
          $ref: '#/components/schemas/Country'
        reference:
          type: string
          description: The partner's order reference.
        description:
          type:
            - string
            - 'null'
        capture_method:
          $ref: '#/components/schemas/CaptureMethod'
        customer:
          type:
            - string
            - 'null'
        customer_email:
          type:
            - string
            - 'null'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/LineItem'
        store_payment_method:
          type: boolean
        locale:
          type: string
          examples:
            - en-GB
        return_url:
          type: string
          format: uri
        url:
          type: string
          format: uri
          description: Hosted checkout URL. Contains the client secret in the URL fragment.
        client_secret:
          type: string
          description: Pass to Kalixo.js. Do not log or store it in analytics.
        amount_locked:
          type: boolean
          description: True once the first payment attempt has started.
        payment_link:
          type:
            - string
            - 'null'
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        livemode:
          type: boolean
        metadata:
          $ref: '#/components/schemas/Metadata'
    CheckoutSessionStatus:
      type: string
      enum:
        - open
        - complete
        - expired
    Amount:
      type: integer
      format: int64
      minimum: 0
      description: Amount in the currency's minor unit.
    Currency:
      type: string
      pattern: ^[A-Z]{3}$
      description: ISO 4217 currency code, uppercase.
      examples:
        - EUR
    Country:
      type: string
      pattern: ^[A-Z]{2}$
      description: ISO 3166-1 alpha-2 country code of the shopper.
      examples:
        - NL
    CaptureMethod:
      type: string
      enum:
        - automatic
        - manual
    LineItem:
      type: object
      required:
        - name
        - quantity
        - unit_amount
      properties:
        name:
          type: string
          maxLength: 200
        quantity:
          type: integer
          minimum: 1
        unit_amount:
          $ref: '#/components/schemas/Amount'
        tax_amount:
          $ref: '#/components/schemas/Amount'
        tax_percentage:
          type: integer
          description: Tax percentage in basis points (21% = 2100).
        sku:
          type: string
          maxLength: 100
        product_url:
          type: string
          format: uri
        image_url:
          type: string
          format: uri
    Metadata:
      type: object
      description: >-
        Up to 50 keys. Keys up to 40 characters, values up to 500 characters.
        Echoed back unchanged.
      additionalProperties:
        type: string
        maxLength: 500
      maxProperties: 50
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - idempotency_error
                - payment_error
                - rate_limit_error
                - api_error
            code:
              type: string
              examples:
                - amount_locked
            decline_code:
              type:
                - string
                - 'null'
            message:
              type: string
            param:
              type:
                - string
                - 'null'
            request_id:
              type: string
  responses:
    Error:
      description: Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: Secret key, `kc_sk_test_...` or `kc_sk_live_...`. Server-side only.

````

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