Ship-To Selection and Email Selection on Draft Contracts

Draft contracts can now choose a shipping customer, billing/shipping address and email selection,
the same as contracts. The review page starts from them when the draft is confirmed.

POST /draft-contracts and PUT /draft-contracts/{draft_contract_id} accept shipping_customer_id,
billing_address_id and shipping_address_id. On create, omit an address id to use the customer's
first address, or send null for none. On update, omit a field to keep its current value or send
null to remove the address; null as shipping_customer_id removes the shipping customer and its
shipping address. Changing the ship-to customer without a shipping_address_id uses that customer's
first shipping address. Changing customer_id removes the billing address and, if the draft shipped to
its previous customer, the shipping customer and shipping address too.

Email selection on draft contracts

  • Draft contracts 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 /draft-contracts and change it on PUT /draft-contracts/{draft_contract_id}.
    Leaving it out on create stores no selection, returned as null, and the review page starts from
    all customer emails; leaving it out on update keeps it. Changing customer_id removes it.
  • A SELECTED_EMAILS selection with no MAIN_SENDER recipient stores no selection, the same as the
    review page.

Draft contracts now return shipping_customer_id, billing_address and shipping_address, and
email_selection. Re-creating a draft contract with POST /draft-contracts and the same external
reference replaces these values; use PUT to change them.

Applies to V4 only.