Shopify B2B payment terms in n8n: before-due reminders, overdue report, and a GraphQL filter that silently returns every order

Shopify’s own payment reminders only fire on/after the due date and there’s no “who owes what” view, so I built this in n8n for wholesale stores on Net 30/60.

How it works

  • Schedule Trigger (daily) → one Admin GraphQL query for unpaid orders with paymentTerms
  • Code node works out days to/past due and the outstanding amount (partial payments counted), and picks orders on reminder days (−3, 0, +7, +14, +30)
  • Multipart email to the buyer (plain text + HTML helped a lot with spam folders), and a daily owner report by email or Slack
  • A second workflow on orders/create checks whether the buyer’s company already has overdue orders and tags the new order credit-hold

Gotchas I hit

  1. orders(query: "company_id:…") isn’t a valid filter. Shopify returns all orders with only a warning. Query company { orders } instead.
  2. On n8n 2.x an error workflow only runs if it’s active.
  3. orderCreateManualPayment with a partial amount needs Plus; REST transactions.json works for testing.

The free wholesale order alert template it’s built on: Shopify Wholesale Order Alert: free n8n template
The full reminders version (3 workflows + guide) is on n8n templates for Shopify · TrenoxaHQ

Happy to answer questions.

1 Like