Updates an ad hoc invoice while it is in the draft state.
Important: only invoices with the adhoc role and draft status can be updated. Any other invoice — issued, or with a different role (e.g. renewal, signup) — cannot be updated through this endpoint and the request returns a 422 error. If the invoice does not belong to the provided subscription, a 404 error is returned.
Only the attributes submitted in the request are changed — omitted attributes keep their current values.
The line_items array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged.
A line item without a uid is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, product_id, component_id, price points, period date ranges, taxes).
A line item with the uid of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated.
A line item with a uid and "_destroy": true is removed from the invoice. Other line items remain unchanged.
Referencing a uid which does not exist on the invoice returns a 422 error.
When the coupons key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation.
The issue_date parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the YYYY-MM-DD format. The net_terms parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change.
The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a first_name at a minimum in order to work. Taxes are recalculated after an address change.
A custom memo can be sent with the memo parameter. Likewise, custom payment instructions can be sent with the payment_instructions parameter.
The username is a Maxio Chargify API key and the password is x. Basic authentication works only with the US and EU environments, which connect to chargify.com directly. The Maxio API Gateway environment does not accept Basic authentication.
In: header
The Chargify id of the subscription.
The unique identifier for the invoice, this does not refer to the public facing invoice number.
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request payload for updating a draft ad hoc invoice.
application/json
application/json
application/json
curl -X PUT \ --url 'https://subdomain.chargify.com/subscriptions/1/invoices/uid.json' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ --data-raw '{ "invoice": { "net_terms": 30, "memo": "Updated memo" }}'Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed.