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

# One Time Charge

> Charge a one-time amount against an existing subscription using its saved payment method.



## OpenAPI

````yaml POST /subscription/merchant/one-time-charge
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:
  /subscription/merchant/one-time-charge:
    post:
      description: >-
        Charge a one-time amount against an existing subscription using its
        saved payment method.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        description: Subscription One Time Charge
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/subs-one-time-charge'
        required: true
      responses:
        '200':
          description: Subscription One Time Charge response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subs-one-time-charge-response'
              examples:
                success:
                  summary: 200 - Success
                  value:
                    intentId: in_gKAqR0DjLeOihdTE
                    status: SUCCESS
                    errorCode: null
                    errorMessage: null
                failed:
                  summary: 200 - Fail
                  value:
                    intentId: in_gKAqR0DjLeOihdTE
                    status: FAILED
                    errorCode: card_declined
                    errorMessage: The payment has been declined by the customer's bank.
        '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:
    subs-one-time-charge:
      required:
        - subscriptionId
        - amount
        - currency
      type: object
      properties:
        subscriptionId:
          description: >-
            Unique identifier of the subscription to charge against. The
            subscription's saved payment method will be used for this charge.
          type: string
          example: sub_fooBOwYsaK50AEfK
        amount:
          description: >-
            The amount in lowest count unit. e.g.: For USD 1, amount is 100
            representing 100 cents. Must be within the currency's supported
            minimum and maximum bounds.
          type: integer
          format: int64
          example: 500
        currency:
          type: string
          description: >-
            Three letter abbreviation of the currency. Refer [supported
            currencies](/get-started/currencies-supported)
          example: USD
        comments:
          description: >-
            Optional free-form note describing the reason for this one-time
            charge.
          type: string
          example: One-time setup fee for premium add-on
    subs-one-time-charge-response:
      type: object
      properties:
        intentId:
          type: string
          description: >-
            Unique identifier of the payment intent created for this one-time
            charge.
          example: in_gKAqR0DjLeOihdTE
        status:
          type: string
          description: >-
            The status of the payment intent. Refer [payment intent
            status](/products/one-time-payments/payment-statuses)
          example: SUCCESS
        errorCode:
          type: string
          nullable: true
          description: >-
            Machine readable failure reason when status is `FAILED`. `null` on a
            successful charge. [See all possible values
            here.](/products/one-time-payments/error-codes)
          example: card_declined
        errorMessage:
          type: string
          nullable: true
          description: >-
            Human readable description of the failure reason when the charge was
            not successful. `null` on a successful charge.
          example: The payment has been declined by the customer's bank.
    Error:
      required:
        - errorCode
        - errorDescription
      type: object
      properties:
        errorCode:
          type: string
          example: bad_request
        errorDescription:
          type: string
          example: Failed to read request
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````