Shopify Payment Terms - Deferred Payments - Draft Orders API

Hi Erik

I would like to be able to add payment terms programmatically to unpaid orders. The use case is to automatically assign a ‘pay by’ date to these orders which can be used by automations to remind customers to make payment (eg send sms 2 days before, cancel order if order = unpaid beyond pay by date)

I’ve found my way around Admin GraphQL and so far can do the below basic edits.

The ability to edit/update payment terms per order via OrderUpdate or even OrderEditBegin does not appear to be exposed via Admin GraphQL.
The ability to edit payment terms themselves is exposed though which doesn’t seem as useful as being able to apply payment terms to orders.

Any ideas on how to achieve the above?

In other words I’d like to automate via Flow, GraphQL this process detailed in the help.

  1. From your Shopify admin, go to Orders.

  2. From the Orders page, click order number.

  3. In the Pending section, click Add payment terms.

  4. Select one of the following Payment terms:

    • To set the payment due on the day that you send the invoice, select Due on receipt.
    • To set the payment due within a time duration of an issue date, select one of the Within days options, and then enter the Issue date.
    • To set the payment due on a specific day, select Fixed date, and then enter the Due date.
  5. Click Save.

mutation orderUpdate {
  orderUpdate(input: {id: "gid://shopify/Order/xxxxx", note: "Unpaid Order", customAttributes: {key: "Payment Due", value: "2021/10/21"}}) {
    userErrors {
      field
      message
    }
    order { 
      note
      # Order fields
    }
  }
}