Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Add Charge

Add a one time charge
client.v1.customers.invoices.addCharge(InvoiceAddChargeParamsparams, RequestOptionsoptions?): InvoiceAddChargeResponse
post/v1/customers/{customer_id}/addCharge

Add a one time charge to the specified invoice

Parameters
paramscustomer_idstringcharge_idstringcustomer_plan_idstringdescriptionstringinvoice_start_timestampstringpricenumberquantitynumberInvoiceAddChargeParams
Hide ParametersShow Parameters
customer_idstring

Path param:

formatuuid
charge_idstring

Body param: The Metronome ID of the charge to add to the invoice. Note that the charge must be on a product that is not on the current plan, and the product must have only fixed charges.

formatuuid
customer_plan_idstring

Body param: The Metronome ID of the customer plan to add the charge to.

formatuuid
descriptionstring

Body param:

invoice_start_timestampstring

Body param: The start_timestamp of the invoice to add the charge to.

formatdate-time
pricenumber

Body param: The price of the charge. This price will match the currency on the invoice, e.g. USD cents.

quantitynumber

Body param:

Returns
InvoiceAddChargeResponse
import Metronome from '@metronome/sdk';

const client = new Metronome({
  bearerToken: 'My Bearer Token',
});

const response = await client.v1.customers.invoices.addCharge({
  customer_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
  charge_id: '5ae4b726-1ebe-439c-9190-9831760ba195',
  customer_plan_id: 'a23b3cf4-47fb-4c3f-bb3d-9e64f7704015',
  description: 'One time charge',
  invoice_start_timestamp: '2024-01-01T00:00:00Z',
  price: 250,
  quantity: 1,
});

console.log(response);
200 Example
{}