v1

latestOpenAPI 3.0.02026-07-24161215397.4 KB
Charges

Update a charge for invoice

Update a charge for the specified invoice.

Required scopes: flex.billing.charges.update

put/api/v2/organizations/{orgSlug}/charges/{chargeId}

Path parameters

chargeIdstring required

Id of the charge.

orgSlugstring required

organization slug

Request body

paymentstring required

The id of the payment for which the charge should be updated

datestring

The date of the charge

amountnumber

The amount of the charge.

referencestring

A short description of the charge

providerChargeReferencestring

Provider payment gateway charge reference used for reconciliation and operational tooling.

status'pending' | 'fail' | 'success' | 'refund'

The status of the charge.

Example request

{
  "payment": "6080186f490fcf6e0547ec50",
  "date": "2025-08-20T00:00:00.000Z",
  "amount": 100,
  "reference": "Charge Reference 1",
  "providerChargeReference": "ch_3ABC123DEF456"
}

Response

_idstring required

The _id of the charge.

amountnumber required

The amount of the charge.

currencystring

The currency of the charge.

accountstring

The account to which the charge is allocated.

referencestring

A short description of the charge

datestring

The date of the charge.

sourcestring

The source of the charge. The source will be an accounting integration if the charge is synced from an integration.

status'pending' | 'fail' | 'success' | 'refund'

The status of the charge.

paymentstring

Reference to the invoice, to which the charge belongs to.

providerChargeReferencestring

The payment gateway reference for the charge (e.g., Stripe charge ID).

createdAtstring date-time

The date when the charge has been created at.

createdBystring

The user that created the charge.

modifiedAtstring date-time

The date when the charge has been modified for the last time.

modifiedBystring

The user that did the last modification to the charge. Before the first modification, this field equals to the createdBy field.

Example response

{
  "_id": "6080186f490fcf6e0547ec50",
  "amount": 15,
  "currency": "USD",
  "account": "Cash",
  "reference": "Charge Reference 1",
  "date": "2025-01-01T00:00:00.000Z",
  "accounting": {
    "provider": "xero",
    "providerId": "123456789",
    "externalOrgId": "987654321",
    "deepLink": "https://quickbooks.com/123456789",
    "lastSync": "2025-01-01T00:00:00.000Z",
    "error": "An error occurred while syncing with Xero"
  },
  "source": "API",
  "payment": "6080186f490fcf6e0547ec50",
  "providerChargeReference": "ch_3ABC123DEF456",
  "createdAt": "2025-01-01T00:00:00.000Z",
  "createdBy": "6080186f490fcf6e0547ec50",
  "modifiedAt": "2025-01-01T00:00:00.000Z",
  "modifiedBy": "6080186f490fcf6e0547ec50"
}