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

# Preview Card Payment

> This endpoint validates card payment details like Amount, Order Reference and verifies Method availability



## OpenAPI

````yaml POST /payments/preview-card-payment
openapi: 3.0.1
info:
  title: CORE API OpenAPI Specification
  description: This is the API documentation for the ClickPesa CORE API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.clickpesa.com/third-parties
security:
  - bearerAuth: []
paths:
  /payments/preview-card-payment:
    post:
      tags:
        - Payments
        - Preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - orderReference
                - currency
              properties:
                amount:
                  type: string
                  description: Your payment amount
                currency:
                  type: string
                  enum:
                    - USD
                orderReference:
                  type: string
                  description: Your unique Order reference
                checksum:
                  type: string
                  description: >-
                    If enabled, this is the generated checksum of the payload.
                    Refer to the
                    [documentation](https://docs.clickpesa.com/home/checksum)
                    for more details.
      responses:
        '200':
          description: Preview Card response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewCardPaymentResponse'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewCardPaymentValidationError'
        '401':
          description: Invalid or Expired Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Not Found Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewCardPaymentNotFoundError'
        '409':
          description: Conflict Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewCardPaymentConflictError'
components:
  schemas:
    PreviewCardPaymentResponse:
      type: object
      properties:
        activeMethods:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Payment method name (VISA/MASTER CARD)
              status:
                type: string
                enum:
                  - AVAILABLE
                  - UNAVAILABLE
                description: Status of the payment method
              fee:
                type: integer
                description: Fee amount if the payment method is available.
              message:
                type: integer
                description: Message if the payment method is unavailable.
    PreviewCardPaymentValidationError:
      type: object
      properties:
        message:
          type: string
          enum:
            - Valid Client ID is required
            - >-
              Application has no access to COLLECTION API feature. Enable it on
              your application.
            - >-
              Invalid Order Reference, should only contain alphanumeric
              characters and cannot be blank
          example: >-
            Invalid Order Reference, should only contain alphanumeric characters
            and cannot be blank
    UnauthorizedError:
      type: object
      properties:
        message:
          type: string
          description: Unauthorized Error
          example: Unauthorized
    PreviewCardPaymentNotFoundError:
      type: object
      properties:
        message:
          type: string
          enum:
            - Account has no payment collection methods
            - Account has no valid payment method
          example: Account has no payment collection methods
    PreviewCardPaymentConflictError:
      type: object
      properties:
        message:
          type: string
          description: Conflict message when an order reference is already used
          example: >-
            Order reference {Your reference} already used: Create a different
            reference
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization header containing the JWT access token returned from the
        generate token endpoint. The token already includes the Bearer prefix.
        Example: `Authorization: Bearer eyJhbGciOi...`
      bearerFormat: JWT

````