Invoices

Preview Customer Information Changes

POST
/invoices/{uid}/customer_information/preview.json

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.

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.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/invoices/string/customer_information/preview.json"
{  "changes": {    "payer": {      "before": {        "last_name": "Beatty"      },      "after": {        "last_name": "Doe"      }    },    "shipping_address": {      "before": {        "line2": "Suite 703"      },      "after": {        "line2": "Suite 702"      }    },    "billing_address": {      "before": {        "line2": "Suite 703"      },      "after": {        "line2": "Suite 702"      }    },    "custom_fields": {      "before": [        {          "owner_id": 1002,          "owner_type": "Customer",          "name": "Color",          "value": "blue",          "metadatum_id": 20        }      ],      "after": [        {          "owner_id": 1002,          "owner_type": "Customer",          "name": "Color",          "value": "green",          "metadatum_id": 20        }      ]    }  }}

Send Invoice POST

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.

Update Customer Information PUT

Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side.