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

# Attempt a charge for an invoice



## OpenAPI

````yaml /openapi.json post /customers/{customerId}/retry-charge
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /customers/{customerId}/retry-charge:
    post:
      tags:
        - customer
      summary: Attempt a charge for an invoice
      operationId: CustomerController_charge
      parameters:
        - name: customerId
          required: true
          in: path
          description: The customer id
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RetryChargeInputBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryChargeOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidProductErrorDto'
              examples:
                INVALID_PRODUCT:
                  $ref: '#/components/schemas/InvalidProductErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CustomerNotFoundErrorDto'
                  - $ref: '#/components/schemas/PaymentMethodNotFoundErrorDto'
              examples:
                CUSTOMER_NOT_FOUND:
                  $ref: '#/components/schemas/CustomerNotFoundErrorDto'
                PAYMENT_METHOD_NOT_FOUND:
                  $ref: '#/components/schemas/PaymentMethodNotFoundErrorDto'
          description: ''
components:
  schemas:
    RetryChargeInputBody:
      type: object
      properties:
        invoiceId:
          type: string
          description: the invoice id to retry a charge on
        paymentMethodId:
          type: string
          description: >-
            Payment method to use. If not provided, the default payment method
            will be used.
      required:
        - invoiceId
    RetryChargeOutput:
      type: object
      properties: {}
    InvalidProductErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_PRODUCT
        message:
          type: string
          example: Invalid product {product}
        details:
          $ref: '#/components/schemas/InvalidProductDetailsDto'
      required:
        - code
        - message
        - details
    CustomerNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CUSTOMER_NOT_FOUND
        message:
          type: string
          example: Customer {customerId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/CustomerNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    PaymentMethodNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - PAYMENT_METHOD_NOT_FOUND
        message:
          type: string
          example: No payment method found for payment method id {paymentMethodId}
        details:
          $ref: '#/components/schemas/PaymentMethodNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    InvalidProductDetailsDto:
      type: object
      properties:
        tenant:
          type: string
        product:
          type: string
        expectedProduct:
          type: string
      required:
        - product
    CustomerNotFoundDetailsDto:
      type: object
      properties:
        customerId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - customerId
    PaymentMethodNotFoundDetailsDto:
      type: object
      properties:
        paymentMethodId:
          type: string
      required:
        - paymentMethodId

````