Delete All Customer’s Invoices

DELETE https://api.chartmogul.com/v1/data_sources/{DATA_SOURCE_UUID}/customers/{CUSTOMER_UUID}/invoices

Deletes all invoices for a given customer and data source.

curl -X DELETE "https://api.chartmogul.com/v1/data_sources/ds_fef05d54-47b4-431b-aed2-eb6b9e545430/customers/cus_f466e33d-ff2b-4a11-8f85-417eb02157a7/invoices" \
     -u YOUR_API_KEY: \
     -H "Content-Type: application/json"
ChartMogul::CustomerInvoices.destroy_all!(
  "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  "cus_f466e33d-ff2b-4a11-8f85-417eb02157a"
)
Invoice.destroy_all(
  "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  "cus_f466e33d-ff2b-4a11-8f85-417eb02157a"
);
ChartMogul\CustomerInvoices::destroyAll(
  "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  "cus_f466e33d-ff2b-4a11-8f85-417eb02157a"
);
api.DeleteCustomerInvoices(
  "ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  "cus_f466e33d-ff2b-4a11-8f85-417eb02157a",
)
chartmogul.Invoice.destroy_all(
  config,
  data_source_uuid="ds_fef05d54-47b4-431b-aed2-eb6b9e545430",
  customer_uuid="cus_f466e33d-ff2b-4a11-8f85-417eb02157a",
)
{}
true
{}
true
nil
None

Impact of this action. This request will delete the invoice and all associated data, including line items and transactions. If this is the only invoice for a subscription, deleting this invoice will also remove the subscription. Metrics for the customer will be recalculated based on the billing data remaining after this action.

For automatic sources like Stripe or Recurly, a deleted invoice may be restored during a re-sync. For other sources, deleting an invoice is permanent.

Disabling an invoice. If you’re using Stripe, Chargebee, Recurly or Braintree (the latest version of the integration), you have the option to disable an invoice rather than delete it.

Path parameters

data_source_uuid string required
The ChartMogul UUID of the data source for which invoices need to be deleted.
customer_uuid string required
The ChartMogul UUID of the customer for which invoices need to be deleted.