Customer Email IDs and Email Recipients on Contracts and Invoices

You can now choose which of a customer's emails an invoice is sent to — for each contract and for each
standalone invoice.

Customer email IDs

  • Each customer email has a stable id, returned on customer responses and customer webhooks.
  • On PUT /customers/{customer_id}, send an email's id to keep or edit it; emails without an
    id are added and emails left out are removed. Two emails can swap address or type in one update.
  • An email id is not accepted on POST /customers and is rejected with 400, so remove the ids
    when copying a customer response into a new customer.
  • Breaking: sending the same address and type twice (ignoring case and surrounding spaces) is now
    rejected with 400. Previously the repeat was merged into one email.

Email selection on contracts and invoices

  • Contracts and invoices now carry email_selection: mode is ALL_CUSTOMER_EMAILS (every
    email on the billing customer, each as its own type) or SELECTED_EMAILS (only recipients,
    each with its own recipient_type).
  • Set it on POST /contracts and POST /invoices, and change it on PUT /invoices/{invoice_id}.
    Leaving it out on create sends to all customer emails; leaving it out on update keeps it.
  • An invoice generated by a contract uses the contract's selection. Sending that selection back
    is accepted; a different one is rejected with 400.

Removing a customer email, or changing its address without its id, removes it from every
selection. If that leaves a selection with no recipients, those invoices are not sent until
recipients are added or the selection is switched to ALL_CUSTOMER_EMAILS.

Applies to V4 only.