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

# Charge Customer

> Charge Customer



## OpenAPI

````yaml post /customers/charge/{customerId}
openapi: 3.0.3
info:
  title: Fractal
  version: 1.0.0
  contact: {}
servers:
  - url: https://testapi.fractalpay.com/api/v1
    description: Sandbox
  - url: https://api.fractalpay.com/api/v1
    description: Production
security: []
tags:
  - name: Merchant Onboarding
  - name: Payment Collection Methods
  - name: Requests
  - name: Preauthorizations
  - name: Customers
  - name: Charging Customer
  - name: Transactions
paths:
  /customers/charge/{customerId}:
    parameters:
      - name: customerId
        in: path
        required: true
        description: >-
          The customer's unique ID. Returned in the `customer_id` field of the
          Create Customer (`POST /customers/add`) response. To retrieve a list
          of all customers and their IDs, use the Get Customers (`GET
          /customers`) endpoint.
        schema:
          type: string
    post:
      tags:
        - Customers
        - Charging Customer
      summary: Charge Customer
      description: Charge Customer
      operationId: chargeCustomer
      parameters:
        - name: ''
          in: query
          schema:
            type: string
            example: ''
        - name: ''
          in: header
          schema:
            type: string
            example: 9ee4a08a-2e34-11ef-af4e-0ef0812e6179
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  example: 1
                merchant_key:
                  type: string
                  description: >-
                    The merchant's unique key. Returned in the `merchant_key`
                    field of the get merchants by client call.
                  example: '{{merchant_key}}'
                order_id:
                  type: string
                  example: '5465446'
                preAuth:
                  type: boolean
                  example: true
              required:
                - amount
                - merchant_key
                - order_id
                - preAuth
            examples:
              Charge Customer:
                value:
                  amount: 1
                  merchant_key: '{{merchant_key}}'
                  order_id: '556465'
              Charge Customer PreAuth:
                value:
                  amount: 1
                  merchant_key: '{{merchant_key}}'
                  order_id: '5465446'
                  preAuth: true
          text/plain:
            examples:
              Charge Customer:
                value: |-
                  {
                      "amount": 1.00,
                      // "preAuth": true,
                      "merchant_key":"{{merchant_key}}"
                  }
      responses:
        '200':
          description: Charge Customer / Charge Customer PreAuth
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
                example: '*'
            Connection:
              schema:
                type: string
                example: keep-alive
            Content-Length:
              schema:
                type: string
                example: '115'
            Date:
              schema:
                type: string
                example: Wed, 21 Aug 2024 16:39:46 GMT
            ETag:
              schema:
                type: string
                example: W/"73-pMHpxmBvE9Ipxs6pPFn/qUbFiS4"
            Keep-Alive:
              schema:
                type: string
                example: timeout=5
            X-Powered-By:
              schema:
                type: string
                example: Express
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      transaction_id:
                        type: string
                        example: txn_68e93a56fa
                  message:
                    type: string
                    example: Payment captured successfully.
                  result:
                    type: boolean
                    example: true
                  transaction_id:
                    type: string
                    example: txn_0e99eb7c5a
              examples:
                Charge Customer:
                  value:
                    message: Payment captured successfully.
                    result: true
                    transaction_id: txn_0e99eb7c5a
                Charge Customer PreAuth:
                  value:
                    data:
                      transaction_id: txn_68e93a56fa
                    message: Authorization Approved
                    result: true
      security:
        - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: |-
        Use your Fractal API credentials.

        Username = Client ID
        Password = Secret Key

        Sandbox credentials can be generated from the Test Portal.

````