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

# Create Payment via Card Information (S2S)

> This endpoint allows you to create a card payment intent using raw card information.

- `card_info` object is required and should contain the card number, expiry month/year, CVV, and cardholder name.
- `webhook_notification` object is optional. If not provided, we will use your default webhook configuration that you've previously set up. If provided, we will send webhook notifications to the specified endpoint for this specific payment.
- When the card requires 3DS authentication, we will return a `pay_code` object containing `{3ds_url: ''}`.
  You must direct your customer to this URL to authorise the payment.
  After successful authorisation, the customer will return to `return_url`, and you can use the capture API normally to collect the payment from the user.
- If `capture` is set to `true`, the payment will be automatically captured after successful authorisation.
  If `capture` is set to `false`, the payment will remain in the `authorised` status until you explicitly call the capture API.

When the payment reaches the `authorised` status, a `token` object will be returned in the API response and also included in the webhook notification.
You should save this token to create future payments without requiring your customer to re-enter their card details.




## OpenAPI

````yaml /api/openapi/card-reference.yaml post /v2/cards/charges
openapi: 3.0.2
info:
  title: Card APIs
  description: >
    ---

    ## Overview


    The Hello Clever Card APIs offer a secure and streamlined way to accept and
    manage card payments. With simple endpoints for creating charges, capturing
    funds, and issuing refunds, you can build payment flows that integrate
    cleanly into your system.


    **Integration Methods**

    Choose the integration approach that best fits your architecture and
    compliance needs:


    - **SDK Integration (Client-side)**
      **Supported currencies**: USD and AUD.
      Designed for web and mobile frontends. Integrate the Hello Clever JavaScript SDK to manage payment creation and frontend interactions through a lightweight, drop-in flow.

      > 💡 See the **[SDK Documentation](/guides/sdk-integration)** section below for setup, initialisation, payment creation, and callback handling.

    - **Server-to-Server (S2S) Integration (Server-side)**
      **Supported currency**: AUD.
      Intended for PCI DSS–compliant backend systems. This approach lets you submit raw card information (`card_info`) directly from your server to Hello Clever’s APIs, giving you full control over authorisation, capture, and other server-side payment operations.

      > 💡 See the **[S2S Documentation](/guides/s2s-integration)** section below for endpoint specs, authentication steps, and example payloads.

    Both methods share the same payment lifecycle, including authorisation, 3DS
    authentication, capture, refunds, and webhook notifications, ensuring
    consistent behaviour across SDK and S2S integrations.
  version: 1.0.0
  termsOfService: https://helloclever.co/terms
  contact:
    email: support@helloclever.co
servers:
  - url: https://sandbox-api.lightningpay.me/api
    description: Sandbox Environment
  - url: https://api.lightningpay.me/api
    description: Production Environment
security:
  - app-id: []
    secret-key: []
tags:
  - name: SDK Integration
    description: Integration guide for accepting card payments using JavaScript SDK
  - name: Cards
    description: >
      APIs to manage the entire card payment flow — from creation to refund —
      for full control over your checkout and post-purchase experience.


      **Supported use cases:**

      - Create card payments

      - Show payment status

      - Cancel or void payments (cancel full amount)

      - Partially or fully refund payments

      - Capture pre-authorised payments(full amount)


      **Additional features:**

      - Webhook notifications on payment status changes

      - Post-purchase payment flows for upsell scenarios


      Ideal for partners integrating custom checkout, upsell pages, or payment
      reconciliation flows.
paths:
  /v2/cards/charges:
    post:
      tags:
        - Cards
      summary: Create Payment via Card Information (S2S)
      description: >
        This endpoint allows you to create a card payment intent using raw card
        information.


        - `card_info` object is required and should contain the card number,
        expiry month/year, CVV, and cardholder name.

        - `webhook_notification` object is optional. If not provided, we will
        use your default webhook configuration that you've previously set up. If
        provided, we will send webhook notifications to the specified endpoint
        for this specific payment.

        - When the card requires 3DS authentication, we will return a `pay_code`
        object containing `{3ds_url: ''}`.
          You must direct your customer to this URL to authorise the payment.
          After successful authorisation, the customer will return to `return_url`, and you can use the capture API normally to collect the payment from the user.
        - If `capture` is set to `true`, the payment will be automatically
        captured after successful authorisation.
          If `capture` is set to `false`, the payment will remain in the `authorised` status until you explicitly call the capture API.

        When the payment reaches the `authorised` status, a `token` object will
        be returned in the API response and also included in the webhook
        notification.

        You should save this token to create future payments without requiring
        your customer to re-enter their card details.
      operationId: createPaymentViaCardInformationServerToServer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - currency
                - email
                - first_name
                - last_name
                - description
                - billing_address
                - card_info
                - external_id
                - return_url
              properties:
                amount:
                  type: number
                  description: Amount in smallest currency unit (e.g., cents)
                  example: 1000
                currency:
                  type: string
                  description: ISO 4217 currency code (e.g., AUD)
                  example: AUD
                email:
                  type: string
                  format: email
                  description: Customer's email.
                  example: email@gmail.com
                first_name:
                  type: string
                  description: Customer's first name.
                  example: John
                last_name:
                  type: string
                  description: Customer's last name.
                  example: Doe
                billing_address:
                  type: object
                  description: Customer’s billing address details.
                  required:
                    - street_address
                    - city
                    - state
                    - country
                    - postal_code
                  properties:
                    address:
                      type: string
                      description: Address (building number, road name, etc.).
                      example: 123 Main Street
                    city:
                      type: string
                      description: City, district, or locality.
                      example: Sydney
                    state:
                      type: string
                      description: State, province, or region.
                      example: NSW
                    country:
                      type: string
                      description: ISO 3166-1 alpha-2 country code.
                      example: AU
                    postal_code:
                      type: string
                      description: ZIP or postal code.
                      example: '2000'
                card_info:
                  type: object
                  description: |
                    Card information.
                  required:
                    - card_number
                    - card_expiry_month
                    - card_expiry_year
                    - card_cvv_number
                    - card_holder_name
                  properties:
                    card_number:
                      type: string
                      description: The card number
                      example: '4111111111111111'
                    card_expiry_month:
                      type: integer
                      description: Expiry month of the card (1–12)
                      example: 12
                    card_expiry_year:
                      type: integer
                      description: Expiry year of the card (4-digit)
                      example: 2028
                    card_cvv_number:
                      type: string
                      description: The card verification value/code (3–4 digits)
                      example: '123'
                    card_holder_name:
                      type: string
                      description: Cardholder’s name as printed on the card
                      example: John Doe
                payment_type:
                  type: string
                  description: The type of payment.
                  enum:
                    - regular
                    - unscheduled
                  default: regular
                charge_reason:
                  type: string
                  description: >-
                    Indicates the reason for a merchant-initiated payment
                    request. Should be provided if `payment_type` is
                    `unscheduled`.
                  enum:
                    - resubmission
                    - delayed_charge
                    - no_show
                    - reauthorisation
                  example: resubmission
                previous_payment_uuid:
                  type: string
                  format: uuid
                  description: >-
                    An identifier that links the payment to an existing series
                    of payments. Should be provided if `payment_type` is
                    `unscheduled`.
                  example: 1GKPTU7E
                browser_details:
                  type: object
                  description: |
                    Browser details information.
                  required:
                    - user_agent
                    - language
                    - color_depth
                    - screen_height
                    - screen_width
                    - java_enabled
                    - time_zone
                    - accept_header
                    - javascript_enabled
                  properties:
                    user_agent:
                      type: string
                      description: Exact content of the HTTP user-agent header
                      example: >-
                        Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)
                        AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0
                        Safari/537.36
                    language:
                      type: string
                      description: The browser language as defined in IETF BCP47
                      example: en-US
                    color_depth:
                      type: number
                      description: >-
                        The bit depth of the colour palette for displaying
                        images, in bits per pixel
                      example: 24
                    screen_height:
                      type: number
                      description: Total height of the Cardholder’s screen in pixels
                      example: 1080
                    screen_width:
                      type: number
                      description: Total width of the cardholder’s screen in pixels
                      example: 1920
                    java_enabled:
                      type: boolean
                      description: The ability of the cardholder browser execute JavaScript
                      example: true
                    time_zone:
                      type: number
                      description: >-
                        Time-zone offset in minutes between UTC and the
                        Cardholder browser local time
                      example: -600
                    accept_header:
                      type: string
                      description: Exact content of the HTTP accept headers
                      example: >-
                        text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
                    javascript_enabled:
                      type: boolean
                      description: The ability of the cardholder browser execute JavaScript
                      example: true
                ip_address:
                  type: string
                  description: The IP address of the cardholder
                  example: 192.168.1.1
                capture:
                  type: boolean
                  description: Whether to auto capture the payment (if applicable)
                  default: false
                external_id:
                  type: string
                  description: External ID
                  example: order_test_xxx
                return_url:
                  type: string
                  description: Return URL
                  example: https://example.com
                description:
                  type: string
                  description: Description for the payment.
                  example: 'Payment for invoice #1234'
                webhook_notification:
                  type: object
                  required:
                    - endpoint_url
                    - authorization_header
                  properties:
                    endpoint_url:
                      type: string
                      format: uri
                      description: Your webhook endpoint to receive status updates
                      example: https://merchant.com/webhook
                    authorization_header:
                      type: string
                      description: Optional token for webhook authorization
                      example: Bearer xxxxxx
      responses:
        '200':
          description: Payment created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/card_payment_s2s'
              example:
                example:
                  uuid: PSADT5CE
                  name: Hello Clever
                  email: test@example.com
                  external_id: order_test_xxx
                  status: pending
                  pay_code:
                    3ds_url: https://3ds-auth.example.com/verify
                  currency: AUD
                  amount: '200.0'
                  total: '200.0'
                  paid_amount: '0.0'
                  is_refundable: false
                  payment_method: card
                  expired_at: ''
                  webhook_notification:
                    endpoint_url: https://webhook.site/12da7803-c4cf-4f32-812d-aaeaecf20d9d
                    authorization_header: '****'
                  refund_information: null
                  sender_details:
                    card:
                      card_type: card
                      card_brand: visa
                      card_last_4: '1111'
                      card_country: US
                  capture: false
                  token:
                    id: tok_dfe1988a1ffc0d6562d3
                    type: card
                  created_at: 2025-05-29T01:29:16.826+0000
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
              example:
                errors:
                  code: REQUIRE_LOGIN
                  message: Not Authorised
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                example:
                  errors:
                    code: currency_required
                    message: Currency is required.
components:
  schemas:
    card_payment_s2s:
      type: object
      properties:
        uuid:
          type: string
          example: 7PPPMXIGH
        name:
          type: string
          example: Testing
        email:
          type: string
          example: test@example.com
        external_id:
          type: string
          example: wc_order_6C1hcvg4T7Pom
        status:
          type: string
          enum:
            - pending
            - authorised
            - waiting
            - received
            - expired
            - return_pending
            - return_expired
            - partially_refunded
            - return_received
            - return_rejected
            - failed
            - in_dispute
            - dispute_lost
          example: waiting
        pay_code:
          type: object
          nullable: true
          properties:
            3ds_url:
              type: string
              example: https://3ds-auth.example.com/verify
        currency:
          type: string
          example: USD
        amount:
          type: number
          example: 10000
        total:
          type: number
          example: 10000
        paid_amount:
          type: number
          example: 0
        is_refundable:
          type: boolean
          example: true
        payment_method:
          type: string
          example: card
        expired_at:
          type: string
          example: ''
        webhook_notification:
          type: object
          properties:
            endpoint_url:
              type: string
              example: https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696
            authorization_header:
              type: string
              example: '****'
        refund_information:
          type: object
          properties:
            total_amount:
              type: number
              example: 200
            refund_amount:
              type: number
              example: 50
            description:
              type: string
              example: Testing refund
        sender_details:
          type: object
          properties:
            card:
              type: object
              properties:
                card_type:
                  type: string
                  example: card
                card_brand:
                  type: string
                  example: visa
                card_last_4:
                  type: string
                  example: '4242'
                card_country:
                  type: string
                  example: US
        capture:
          type: boolean
          example: false
        payment_type:
          type: string
          example: regular
        token:
          type: object
          properties:
            id:
              type: string
              example: tok_dfe1988a1ffc0d6562d3
            type:
              type: string
              example: card
        created_at:
          type: string
          format: date-time
          example: 2025-05-28T04:22:21.567+0000
  securitySchemes:
    app-id:
      type: apiKey
      in: header
      name: app-id
      description: |
        A unique identifier assigned to each application.
    secret-key:
      type: apiKey
      in: header
      name: secret-key
      description: |
        A secure token associated with the `app-id`.

````

## Related topics

- [Issue and Manage Card Payments](/developer-reference/api-use-cases/issue-and-manage-cards.md)
- [Card Payment API Overview](/api/card/overview.md)
- [Create Payment via Tokenisation](/api/cards/create-payment-via-tokenisation.md)
