> ## 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.

# Simulate a dispute on a sandbox payment

> Sandbox only. Moves a dispute on a captured payment to `stage`, the way a
real chargeback does. The dispute and its events (`dispute.created`,
`dispute.funds_withdrawn`, `dispute.won`, `dispute.lost`) follow
asynchronously, usually within seconds.

| `stage` | Dispute status | Events |
| --- | --- | --- |
| `opened` | `needs_response` | `dispute.created` |
| `funds_withdrawn` | `funds_withdrawn` | `dispute.funds_withdrawn` |
| `won` | `won` | `dispute.won` |
| `lost` | `lost` | `dispute.lost` |

Later stages apply to the payment's open dispute, or open a new one.
Works for payments made with the sandbox test cards only.




## OpenAPI

````yaml /checkout/openapi.yaml post /v1/test-helpers/payments/{id}/dispute
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.

    - Every response has a `Request-Id` header. Errors repeat it in
    `error.request_id`;
      include it when you contact Kalixo support.
    - Bursts above about 50 requests per second per API key can be rejected with
      `429 rate_limit_error`. Retry with exponential backoff.
    - Request bodies with unknown fields are rejected (`parameter_invalid`).
    Responses
      and events can gain fields at any time; ignore the ones you do not know.
  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, never moves money)
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: Test helpers
    description: Sandbox only. Send test webhook events and simulate disputes.
  - name: Client
    description: Called by Kalixo.js and the hosted checkout. Not for partner servers.
paths:
  /v1/test-helpers/payments/{id}/dispute:
    parameters:
      - $ref: '#/components/parameters/PathId'
    post:
      tags:
        - Test helpers
      summary: Simulate a dispute on a sandbox payment
      description: >
        Sandbox only. Moves a dispute on a captured payment to `stage`, the way
        a

        real chargeback does. The dispute and its events (`dispute.created`,

        `dispute.funds_withdrawn`, `dispute.won`, `dispute.lost`) follow

        asynchronously, usually within seconds.


        | `stage` | Dispute status | Events |

        | --- | --- | --- |

        | `opened` | `needs_response` | `dispute.created` |

        | `funds_withdrawn` | `funds_withdrawn` | `dispute.funds_withdrawn` |

        | `won` | `won` | `dispute.won` |

        | `lost` | `lost` | `dispute.lost` |


        Later stages apply to the payment's open dispute, or open a new one.

        Works for payments made with the sandbox test cards only.
      operationId: simulateDispute
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                stage:
                  type: string
                  enum:
                    - opened
                    - funds_withdrawn
                    - won
                    - lost
                  default: opened
            examples:
              opened:
                $ref: '#/components/examples/SimulateDisputeOpened'
              lost:
                $ref: '#/components/examples/SimulateDisputeLost'
      responses:
        '200':
          description: The simulation was queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisputeSimulation'
              examples:
                queued:
                  $ref: '#/components/examples/DisputeSimulation'
        '400':
          $ref: '#/components/responses/TestHelperBadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/DisputeSimulationConflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
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,
        kept for

        24 hours. A retry with the same key and body returns the stored response
        with the

        header `Idempotent-Replayed: true`.
      schema:
        type: string
        minLength: 1
        maxLength: 255
  examples:
    SimulateDisputeOpened:
      summary: Open a dispute
      value:
        stage: opened
    SimulateDisputeLost:
      summary: Lose the open dispute
      value:
        stage: lost
    DisputeSimulation:
      summary: Dispute notification queued
      value:
        object: dispute_simulation
        payment: pay_01M75N56PRT5WA5G2JF25B20RJ
        dispute: null
        stage: opened
        status: pending
    ErrTestModeOnly:
      summary: test_mode_only
      value:
        error:
          type: invalid_request_error
          code: test_mode_only
          decline_code: null
          message: Test helpers are available in the sandbox only
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrTestHelperUnavailable:
      summary: test_helper_unavailable
      value:
        error:
          type: invalid_request_error
          code: test_helper_unavailable
          decline_code: null
          message: >-
            Dispute simulation works only for payments made with the sandbox
            test cards
          param: id
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrParameterInvalid:
      summary: parameter_invalid
      value:
        error:
          type: invalid_request_error
          code: parameter_invalid
          decline_code: null
          message: amount must be an integer number
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrApiKeyMissing:
      summary: api_key_missing
      value:
        error:
          type: authentication_error
          code: api_key_missing
          decline_code: null
          message: Provide your API key in the Authorization header as a Bearer token
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrApiKeyInvalid:
      summary: api_key_invalid
      value:
        error:
          type: authentication_error
          code: api_key_invalid
          decline_code: null
          message: Invalid API key
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrApiKeyModeMismatch:
      summary: api_key_mode_mismatch
      value:
        error:
          type: authentication_error
          code: api_key_mode_mismatch
          decline_code: null
          message: This environment only accepts test keys
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrSecretKeyRequired:
      summary: secret_key_required
      value:
        error:
          type: authentication_error
          code: secret_key_required
          decline_code: null
          message: This endpoint requires a secret key
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrResourceMissing:
      summary: resource_missing
      value:
        error:
          type: not_found_error
          code: resource_missing
          decline_code: null
          message: 'No such payment: ''pay_01M75N56PRT5WA5G2JF25B20RJ'''
          param: id
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrPaymentNotDisputable:
      summary: payment_not_disputable
      value:
        error:
          type: invalid_request_error
          code: payment_not_disputable
          decline_code: null
          message: Only captured payments can be disputed
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrDisputeAlreadyOpen:
      summary: dispute_already_open
      value:
        error:
          type: invalid_request_error
          code: dispute_already_open
          decline_code: null
          message: >-
            Payment pay_01M75N56PRT5WA5G2JF25B20RJ already has an open dispute
            (dp_01M75ND4F9G3H6J9K3M6N1P4QR)
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrRateLimited:
      summary: rate_limited
      value:
        error:
          type: rate_limit_error
          code: rate_limited
          decline_code: null
          message: Too many requests. Slow down and retry with backoff.
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    ErrInternal:
      summary: internal_error
      value:
        error:
          type: api_error
          code: internal_error
          decline_code: null
          message: An internal error occurred. Retry with the same Idempotency-Key.
          param: null
          request_id: req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
  schemas:
    DisputeSimulation:
      type: object
      required:
        - object
        - payment
        - dispute
        - stage
        - status
      properties:
        object:
          type: string
          const: dispute_simulation
        payment:
          type: string
        dispute:
          type:
            - string
            - 'null'
          description: >-
            The open dispute the stage applies to. `null` when a new dispute
            will be opened.
        stage:
          type: string
          enum:
            - opened
            - funds_withdrawn
            - won
            - lost
        status:
          type: string
          const: pending
          description: The dispute changes asynchronously; watch for `dispute.*` events.
    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
              description: >-
                Stable machine-readable code. Branch on `code`, not on
                `message`.
            decline_code:
              type:
                - string
                - 'null'
              description: Set on declined payments only.
            message:
              type: string
              description: Human-readable explanation. Can change; do not parse it.
            param:
              type:
                - string
                - 'null'
              description: >-
                The request field or header that caused the error, when there is
                one.
            request_id:
              type: string
              description: >-
                Same as the `Request-Id` response header. Include it when you
                contact support.
  responses:
    TestHelperBadRequest:
      description: Invalid request (`invalid_request_error`).
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            test_mode_only:
              $ref: '#/components/examples/ErrTestModeOnly'
            test_helper_unavailable:
              $ref: '#/components/examples/ErrTestHelperUnavailable'
            parameter_invalid:
              $ref: '#/components/examples/ErrParameterInvalid'
    Unauthorized:
      description: Missing, invalid or wrong-mode API key (`authentication_error`).
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            api_key_missing:
              $ref: '#/components/examples/ErrApiKeyMissing'
            api_key_invalid:
              $ref: '#/components/examples/ErrApiKeyInvalid'
            api_key_mode_mismatch:
              $ref: '#/components/examples/ErrApiKeyModeMismatch'
            secret_key_required:
              $ref: '#/components/examples/ErrSecretKeyRequired'
    NotFound:
      description: The object does not exist for your account (`not_found_error`).
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            resource_missing:
              $ref: '#/components/examples/ErrResourceMissing'
    DisputeSimulationConflict:
      description: The payment cannot be disputed in its current state.
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            payment_not_disputable:
              $ref: '#/components/examples/ErrPaymentNotDisputable'
            dispute_already_open:
              $ref: '#/components/examples/ErrDisputeAlreadyOpen'
    TooManyRequests:
      description: >-
        Too many requests (`rate_limit_error`). Wait for `Retry-After` seconds,
        then retry with exponential backoff.
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rate_limited:
              $ref: '#/components/examples/ErrRateLimited'
    ServerError:
      description: Kalixo-side error (`api_error`). Retry with the same `Idempotency-Key`.
      headers:
        Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal_error:
              $ref: '#/components/examples/ErrInternal'
  headers:
    RequestId:
      description: >-
        Unique ID of the request. Send it to Kalixo support. Matches
        `error.request_id`.
      schema:
        type: string
        examples:
          - req_6f1c2a9e0b7d4c3f8a1e5d2b9c0f4a7e
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
        minimum: 1
        examples:
          - 12
  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.