Invoices

Send Invoice

POST
/invoices/{uid}/deliveries.json

Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients.

File Attachments: You can attach files to invoice emails using attachment_urls[] parameter by providing URLs to the files you want to attach. When using attachments, the request must use multipart/form-data content type. Max 10 files, 10MB per file.

If no recipient email addresses are specified in the request, then the subscription's default email configuration will be used. For example, if recipient_emails is left blank, then the invoice will be delivered to the subscription's customer email address.

On success, a 204 no-content response will be returned. The response does not indicate that email(s) have been delivered, but instead indicates that emails have been successfully queued for delivery. If any invalid or malformed email address is found in the request body, the entire request will be rejected and a 422 response will be returned.

Authorization

BasicAuth
AuthorizationBasic <token>

The username is a Maxio Chargify API key. The password is x.

In: header

Path Parameters

uid*string

The unique identifier for the invoice, this does not refer to the public facing invoice number.

Request Body

application/json

recipient_emails?array<string>
Itemsitems <= 5
cc_recipient_emails?array<string>
Itemsitems <= 5
bcc_recipient_emails?array<string>
Itemsitems <= 5
attachment_urls?array<>

Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

Itemsitems <= 10

Response Body

application/json

curl -X POST "https://example.com/invoices/string/deliveries.json" \  -H "Content-Type: application/json" \  -d '{    "recipient_emails": [      "user0@example.com"    ],    "cc_recipient_emails": [      "user1@example.com"    ],    "bcc_recipient_emails": [      "user2@example.com"    ]  }'
Empty

Update Draft Ad Hoc Invoice PUT

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. ### Line Items The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. #### Adding a line item 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). #### Updating a line item A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. #### Removing a line item 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. ### Coupons 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. ### Invoice Options #### Issue Date and Net Terms 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. #### Addresses 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. #### Memo and Payment Instructions A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter.

Preview Customer Information Changes POST

Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side.