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

# Expire Checkout Session

> Expire a checkout session that is still `open`. Once expired, the checkout page can no longer be used to complete a payment, and a checkout session webhook event with status `expired` is delivered. A session cannot be expired if it has already been completed, has already expired, or has a payment in progress.



## OpenAPI

````yaml POST /checkout/session/{id}/expire
openapi: 3.1.0
info:
  title: Clink API
  description: >-
    Official API documentation for Clink's payment processing platform. This API
    enables merchants to create and manage payment sessions, handle
    subscriptions, and process transactions.
  version: 1.0.0
servers:
  - url: https://uat-api.clinkbill.com/api/
security:
  - ApiKeyAuth: []
paths:
  /checkout/session/{id}/expire:
    post:
      summary: Expire Checkout Session
      description: >-
        Expire a checkout session that is still `open`. Once expired, the
        checkout page can no longer be used to complete a payment, and a
        checkout session webhook event with status `expired` is delivered. A
        session cannot be expired if it has already been completed, has already
        expired, or has a payment in progress.
      operationId: expireSession
      parameters:
        - $ref: '#/components/parameters/TimestampHeader'
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the checkout session to expire
      responses:
        '200':
          description: >-
            Checkout session expired successfully; returns the session with
            status `expired`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionGetRes'
              example:
                code: 200
                msg: Success
                data:
                  sessionId: sess_fxpxnm0y8d61169
                  token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
                  status: expired
                  paymentStatus: null
                  amountSubtotal: 10
                  amountTotal: null
                  originalCurrency: USD
                  paymentCurrency: null
                  subscriptionId: null
                  invoiceId: null
                  orderId: null
                  price:
                    priceId: null
                    priceList: null
                    recurring: null
                  merchantReferenceId: mcht_sub_123457
                  showPromotionCode: true
                  uiMode: null
                  returnUrl: null
                  customer: null
                  locale: null
                  cancelUrl: null
                  successUrl: https://merchant.example.com/success
                  created: '2026-09-09 09:07:01'
                  expire: '2026-09-10 09:08:01'
                  product: null
                  priceDataList: null
                  metadata: {}
        '400':
          description: >-
            Session not found, already completed, already expired, or a payment
            is currently in progress on this session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClinkErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClinkErrorResponse'
components:
  parameters:
    TimestampHeader:
      name: X-Timestamp
      in: header
      required: true
      description: >-
        Current timestamp in milliseconds since Unix epoch (required for request
        signing)
      schema:
        type: string
        example: '1783513683000'
  schemas:
    SessionGetRes:
      type: object
      properties:
        code:
          type: integer
          description: Response code, 200 when success
          format: int32
        msg:
          type: string
          example: success
          description: Brief description of what happened, 'success' when happy case
        data:
          $ref: '#/components/schemas/SessionApiVo'
    ClinkErrorResponse:
      type: object
      properties:
        code:
          type: integer
          format: int32
          description: Error code returned by Clink.
        msg:
          type: string
          description: Error message.
        data:
          description: Additional error data, usually null.
    SessionApiVo:
      type: object
      properties:
        sessionId:
          type: string
          description: Unique identifier for the checkout session
        token:
          type: string
          description: Time-limited authentication token for this checkout session
        status:
          type: string
          enum:
            - open
            - completed
            - expired
          description: Current state of the checkout session
        paymentStatus:
          type: string
          enum:
            - unpaid
            - processing
            - paid
          description: Current state of the payment process
        amountSubtotal:
          type: number
          description: Sum of all items before taxes and discounts
        amountTotal:
          type: number
          description: Final amount including all taxes, fees, and discounts
        originalCurrency:
          type: string
          description: Currency specified in the initial request
        paymentCurrency:
          type: string
          description: Currency selected by the customer for payment
        subscriptionId:
          type: string
          description: Unique identifier for recurring billing subscription (if applicable)
        invoiceId:
          type: string
          description: Unique identifier for the generated invoice
        orderId:
          type: string
          description: Unique identifier for the created order
        merchantReferenceId:
          type: string
          description: Your provided reference identifier from the initial request
        locale:
          type: string
          description: Language code for the checkout interface (e.g., en-US)
        uiMode:
          type: string
          enum:
            - elements
            - hostedPage
          description: Checkout UI mode used for this session
        returnUrl:
          type: string
          description: Return URL configured for embedded checkout sessions
        cancelUrl:
          type: string
          description: URL where customers return if they abandon checkout
        successUrl:
          type: string
          description: URL where customers are directed after successful payment
        created:
          type: string
          example: '2026-07-30 12:00:00'
          pattern: ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$
          description: >-
            Timestamp when the session was created. Serialized as "yyyy-MM-dd
            HH:mm:ss" with no offset or timezone designator, so it is not RFC
            3339. Do not assume UTC, the browser timezone, or a per-account
            timezone - none of those is applied by the backend today.
        expire:
          type: string
          example: '2026-07-30 12:00:00'
          pattern: ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$
          description: >-
            Timestamp when the session will expire. Serialized as "yyyy-MM-dd
            HH:mm:ss" with no offset or timezone designator, so it is not RFC
            3339. Do not assume UTC, the browser timezone, or a per-account
            timezone - none of those is applied by the backend today.
        price:
          $ref: '#/components/schemas/PriceApiVo'
          refType: PriceApiVo
        product:
          $ref: '#/components/schemas/ProductApiVo'
          refType: ProductApiVo
        customer:
          $ref: '#/components/schemas/CustomerApiVo'
          refType: CustomerApiVo
        priceDataList:
          type: array
          description: List of product and price information for non-dashboard transactions
          items:
            $ref: '#/components/schemas/PriceData'
          refType: ProductPriceDataVo
        showPromotionCode:
          type: boolean
          description: Whether the promotion code input is shown on the checkout page
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Key-value pairs attached to the session when it was created
    PriceApiVo:
      type: object
      properties:
        priceId:
          type: string
          description: Unique identifier for the price configuration
        priceList:
          type: array
          description: Available price options based on customer's location
          items:
            $ref: '#/components/schemas/PriceDataApiVo'
          refType: PriceDataApiVo
        recurring:
          $ref: '#/components/schemas/RecurringApiVo'
          refType: RecurringApiVo
    ProductApiVo:
      type: object
      properties:
        productId:
          type: string
          description: Unique identifier for the product
        productName:
          type: string
          description: Display name of the product
    CustomerApiVo:
      type: object
      properties:
        customerId:
          type: string
          description: Unique identifier for the customer
        email:
          type: string
          description: Customer's email address for communications and receipts
    PriceData:
      required:
        - name
        - unitAmount
      type: object
      properties:
        name:
          type: string
          description: Display name of the product shown to customers during checkout
        quantity:
          minimum: 1
          type: integer
          description: Number of units to be purchased (minimum 1)
          format: int32
        unitAmount:
          minimum: 0
          exclusiveMinimum: true
          type: number
          description: Price per unit in the specified currency (must be greater than 0)
        currency:
          type: string
          description: Three-letter ISO currency code for the price (e.g., USD, EUR, GBP)
        imageUrl:
          type: string
          description: URL of the product image to display during checkout
    PriceDataApiVo:
      type: object
      properties:
        amount:
          type: number
          description: Price amount in the specified currency
        currency:
          type: string
          description: Three-letter ISO currency code
        exchangeRate:
          type: number
          description: Current exchange rate from original currency
          format: double
    RecurringApiVo:
      type: object
      properties:
        freeTrialDays:
          type: integer
          description: Duration of the free trial period in days
          format: int32
        interval:
          type: string
          enum:
            - week
            - month
            - year
            - day
            - quarter
            - half_year
            - custom
          description: >-
            Frequency of recurring charges. Supported values: day, week, month,
            year, quarter, half_year, custom.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your secret API key obtained from the Clink dashboard (Developers
        section)

````