---
updatedAt: 2026-04-21T05:36:14.000Z
agentTools:
  projectIndex: https://developer.officernd.com/llms.txt
---

# Create a new charge for invoice

Create a new charge for the specified invoice. 

 Required scopes: `flex.billing.charges.create`

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/api/v2/organizations/{orgSlug}/charges": {
      "post": {
        "description": "Create a new charge for the specified invoice. \n\n Required scopes: `flex.billing.charges.create`",
        "operationId": "ChargesController_addItem_api/v2",
        "parameters": [
          {
            "name": "orgSlug",
            "required": true,
            "in": "path",
            "description": "organization slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Charge data to add.",
          "content": {
            "application/json": {
              "schema": {
                "example": {
                  "amount": 100,
                  "date": "2024-09-01T00:00:00Z",
                  "reference": "Charge reference",
                  "account": "Cash",
                  "status": "success",
                  "source": "API",
                  "payment": "Payment id"
                },
                "$ref": "#/components/schemas/AddChargeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeResultDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "flex.billing.charges.create"
            ]
          }
        ],
        "summary": "Create a new charge for invoice",
        "tags": [
          "Charges"
        ]
      }
    }
  },
  "info": {
    "title": "Billing & Product API",
    "description": "",
    "version": "2.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://app.officernd.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://identity.officernd.com/auth/token",
            "scopes": {}
          },
          "authorizationCode": {
            "authorizationUrl": "https://identity.officernd.com/auth/authorize",
            "tokenUrl": "https://identity.officernd.com/auth/token",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "AccountingResultDto": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "description": "The name of the accounting provider.",
            "example": "xero"
          },
          "providerId": {
            "type": "string",
            "description": "The id of the payment in the accounting provider.",
            "example": "123456789"
          },
          "externalOrgId": {
            "type": "string",
            "description": "The organization id in the accounting provider.",
            "example": "987654321"
          },
          "deepLink": {
            "type": "string",
            "description": "A deep link to the payment in the accounting provider.",
            "example": "https://quickbooks.com/123456789"
          },
          "lastSync": {
            "type": "string",
            "description": "The date of the last sync of the payment with the accounting integration.",
            "example": "2025-01-01T00:00:00.000Z"
          },
          "error": {
            "type": "string",
            "description": "An error message with more details about the reason of the failure.",
            "example": "An error occurred while syncing with Xero"
          }
        }
      },
      "ChargeStatus": {
        "type": "string",
        "enum": [
          "pending",
          "fail",
          "success",
          "refund"
        ],
        "description": "The status of the charge."
      },
      "ChargeResultDto": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "The _id of the charge.",
            "example": "6080186f490fcf6e0547ec50"
          },
          "amount": {
            "type": "number",
            "description": "The amount of the charge.",
            "example": 15
          },
          "currency": {
            "type": "string",
            "description": "The currency of the charge.",
            "example": "USD"
          },
          "account": {
            "type": "string",
            "description": "The account to which the charge is allocated.",
            "example": "Cash"
          },
          "reference": {
            "type": "string",
            "description": "A short description of the charge",
            "example": "Charge Reference 1"
          },
          "date": {
            "type": "string",
            "description": "The date of the charge.",
            "example": "2025-01-01T00:00:00.000Z"
          },
          "accounting": {
            "description": "Data on the payment sync with an accounting integration.",
            "example": {
              "provider": "xero",
              "providerId": "123456789",
              "externalOrgId": "987654321",
              "deepLink": "https://xero.com/123456789",
              "lastSync": "2025-01-01T00:00:00.000Z",
              "error": "An error occurred while syncing with Xero"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/AccountingResultDto"
              }
            ]
          },
          "source": {
            "type": "string",
            "description": "The source of the charge. The source will be an accounting integration if the charge is synced from an integration.",
            "example": "API"
          },
          "status": {
            "description": "The status of the charge.",
            "example": "success",
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeStatus"
              }
            ]
          },
          "payment": {
            "type": "string",
            "description": "Reference to the invoice, to which the charge belongs to.",
            "example": "6080186f490fcf6e0547ec50"
          },
          "providerChargeReference": {
            "type": "string",
            "description": "The payment gateway reference for the charge (e.g., Stripe charge ID).",
            "example": "ch_3ABC123DEF456"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string",
            "description": "The date when the charge has been created at.",
            "example": "2025-01-01T00:00:00.000Z"
          },
          "createdBy": {
            "type": "string",
            "description": "The user that created the charge.",
            "example": "6080186f490fcf6e0547ec50"
          },
          "modifiedAt": {
            "format": "date-time",
            "type": "string",
            "description": "The date when the charge has been modified for the last time.",
            "example": "2025-01-01T00:00:00.000Z"
          },
          "modifiedBy": {
            "type": "string",
            "description": "The user that did the last modification to the charge. Before the first modification, this field equals to the createdBy field.",
            "example": "6080186f490fcf6e0547ec50"
          }
        },
        "required": [
          "_id",
          "amount"
        ]
      },
      "AddChargeDto": {
        "type": "object",
        "properties": {
          "payment": {
            "type": "string",
            "description": "The payment for which the charge should be created",
            "example": "6080186f490fcf6e0547ec50"
          },
          "date": {
            "type": "string",
            "description": "The date of the charge",
            "example": "2024-10-31T13:00:00.000Z"
          },
          "amount": {
            "type": "number",
            "description": "The amount of the charge.",
            "example": 1000
          },
          "account": {
            "type": "string",
            "description": "The account with which the charge will be associated.",
            "example": "Cash"
          },
          "reference": {
            "type": "string",
            "description": "A short description of the charge",
            "example": "Charge Reference 1"
          },
          "providerChargeReference": {
            "type": "string",
            "description": "Provider payment gateway charge reference used for reconciliation and operational tooling.",
            "example": "ch_3ABC123DEF456"
          },
          "status": {
            "description": "The status of the charge. If not specified the default status is \"Success\".",
            "example": "success",
            "allOf": [
              {
                "$ref": "#/components/schemas/ChargeStatus"
              }
            ]
          },
          "source": {
            "type": "string",
            "description": "The origin of the charge, you should denote entries created from the API accordingly.",
            "example": "API"
          }
        },
        "required": [
          "payment",
          "date",
          "amount",
          "account"
        ]
      }
    }
  }
}
```