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

# Charge Raw Card

<Note>
  Register the customer's card. Please redirect to the `nextActionRedirectURL`, where the customer can complete the payment with a single click.

  * Use this endpoint when you already gathered card details and consent within your PCI DSS compliant environment
  * You must obtain explicit approval from <a href="mailto:hello@xpaycheckout.com">[hello@xpaycheckout.com](mailto:hello@xpaycheckout.com)</a> before using this API
</Note>


## OpenAPI

````yaml POST /payments/s2s/charge-raw-card
openapi: 3.0.1
info:
  title: xPay API Store
  description: ''
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.xpaycheckout.com
security:
  - basicAuth: []
paths:
  /payments/s2s/charge-raw-card:
    post:
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/charge-raw-card-request'
        required: true
      responses:
        '200':
          description: Charge raw card response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/charge-raw-card-response'
              examples:
                '':
                  summary: ''
                  value:
                    nextActionRedirectionURL: >-
                      https://pay.xpaycheckout.com/?id=in_gKAqC775RFeXjkGM&secret=7Cduomd3LDV6zimJC7vXwh
                    intentId: in_gKAqB3B2aVbFEtbI
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        maxLength: 255
        pattern: ^[a-zA-Z0-9\-_:\.]+$
      description: >-
        A unique key for making the request idempotent. Must match pattern:
        `^[a-zA-Z0-9\-_:\.]+$`. See [Idempotent
        Requests](/developer-resources/idempotency) for more details.
      example: KG5LxwFBepaKHyUD
  schemas:
    charge-raw-card-request:
      allOf:
        - type: object
          required:
            - amount
            - currency
            - cardDetails
            - callbackUrl
          properties:
            amount:
              $ref: '#/components/schemas/Amount'
            currency:
              type: string
              description: >-
                Three letter abbreviation of the currency. Refer [supported
                currencies](/get-started/currencies-supported)
              example: USD
            receiptId:
              description: Your identifier for the order
              type: string
              example: order123
            cardDetails:
              $ref: '#/components/schemas/CardDetails'
            callbackUrl:
              description: >-
                URL that the customer will be redirected to once the payment is
                processed in case 3ds authentication is required.
              type: string
              example: https://example.com/callback
            metadata:
              type: object
              description: >-
                A collection of key-value pairs that can be attached to an
                object for storing additional structured information. This is
                useful for capturing custom data or context-specific attributes.


                Constraints:

                - Maximum of 50 key-value pairs allowed.

                - Each key must be no longer than 40 characters.

                - Each value must be a string and cannot exceed 500 characters.
              additionalProperties:
                type: string
              example:
                orderId: '12345'
                customerNote: Deliver after 5 PM
            customerId:
              $ref: '#/components/schemas/CustomerId'
            customerReferenceId:
              $ref: '#/components/schemas/CustomerReferenceId'
            customerDetails:
              allOf:
                - $ref: '#/components/schemas/BillingDetails'
              description: >-
                Details of the customer. Required if `customerId` is not
                provided.
    charge-raw-card-response:
      type: object
      properties:
        intentId:
          type: string
          description: Identifier of the payment intent created for this charge.
          example: in_gKAqR0DjLeOihdTE
        nextActionRedirectionURL:
          type: string
          description: >-
            URL to redirect your customer to xpay's secure link to complete any
            pending 3DS or next action steps. Present only when additional
            authentication is required.
          example: https://pay.xpaycheckout.com/?id=67f53a6e2097773e4f0112c8
        errorCode:
          type: string
          description: >-
            Machine readable failure reason when status is `FAILED`. [See all
            possible values here.](/products/one-time-payments/error-codes)
          example: insufficient_funds
      required:
        - intentId
        - nextActionRedirectionURL
    Error:
      required:
        - errorCode
        - errorDescription
      type: object
      properties:
        errorCode:
          type: string
          example: bad_request
        errorDescription:
          type: string
          example: Failed to read request
    Amount:
      type: integer
      format: int64
      description: >-
        The amount in lowest count unit. e.g.: For USD 1, amount is 100
        representing 100 cents (The minimum amount should be greater than 1 USD)
      example: 2000
    CardDetails:
      description: Payment card information collected by you
      type: object
      properties:
        cardHolderName:
          type: string
          description: Name of the cardholder
          example: John Doe
        cardNumber:
          type: string
          description: Full Primary Account Number (PAN)
          example: '4000002500000003'
        expiryMonth:
          type: integer
          minimum: 1
          maximum: 12
          description: Card expiry month in MM format
          example: 1
        expiryYear:
          type: integer
          description: Card expiry year in YY format
          example: 28
        cvv:
          type: string
          description: Card security code (CVV/CSC).
          example: '123'
        country:
          type: string
          description: >-
            Two-letter country code ([ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) of the
            country where the card is registered.
          example: US
        postalCode:
          type: string
          description: Postal code of the location where the card is registered.
          example: '2424'
      required:
        - cardNumber
        - expiryMonth
        - expiryYear
        - cvv
    CustomerId:
      type: string
      description: >-
        The unique identifier for the customer, generated via the
        [create-customer
        API](/developer-resources/endpoints/customer/create-customer). This can
        be used to associate the payment with a specific customer in your
        system.
      example: cus_Tfd3Jq1tZxPjYVhRQW2r3
    CustomerReferenceId:
      type: string
      description: >-
        Your unique identifier for the customer. This can be used to associate
        the payment with a specific customer in your system.
      example: eTfd3Jq1tZxPjYVhRQW2r3
    BillingDetails:
      type: object
      description: Billing details for the customer.
      required:
        - name
        - email
        - contactNumber
      properties:
        name:
          type: string
          description: Customer's name
          example: John Doe
        email:
          type: string
          description: Customer's email address
          example: john.doe@example.com
        contactNumber:
          type: string
          description: >-
            Customer's contact number ([E.164
            format](https://en.wikipedia.org/wiki/E.164)), including the country
            code (e.g., +1 for US, +44 for UK, +91 for India).
          example: '+919123456789'
        customerAddress:
          $ref: '#/components/schemas/CustomerAddress'
    CustomerAddress:
      type: object
      properties:
        addressLine1:
          type: string
          description: Line 1 of the customer's address
          example: 123 Main St
        addressLine2:
          type: string
          description: Line 2 of the customer's address
          example: Apt 1
        city:
          type: string
          description: City of the customer's address
          example: New York
        state:
          type: string
          description: State of the customer's address
          example: NY
        country:
          type: string
          description: >-
            Two-letter country code ([ISO 3166-1
            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
          example: US
        postalCode:
          type: string
          description: Postal code
          example: '2424'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````