Setting payment terms using draftOrderCreate

Topic summary

The discussion centers on configuring payment terms and due dates when creating draft orders via Shopify’s GraphQL API.

Initial Problem:
A developer encountered “Access denied” errors when attempting to set payment terms using draftOrderCreate. The mutation worked without the paymentTerms field despite having all Admin API permissions enabled in the GraphiQL App.

Solution - Scope Requirements:
The paymentTerms field requires the payment_terms scope, which is available for private apps but not currently supported in the GraphiQL admin app. Adding this scope to a private app resolved the access error.

Secondary Issue - Missing Template ID:
Multiple users encountered an error: “Payment terms template id can not be empty.” The solution involves querying paymentTermsTemplates to retrieve available templates (e.g., Net-15, Net-30) and their IDs, then referencing the appropriate template in the mutation.

Key Technical Details:

  • Use paymentTermsTemplates query to discover available payment term templates and their dueInDays values
  • When using a template, ensure issuedAt and dueAt dates match the template’s day difference
  • Code examples provided include queries for payment terms templates and mutations for both creating and updating payment terms

Developer Feedback:
Participants expressed frustration about inadequate documentation and the difficulty of discovering required fields and scopes.

Summarized with AI on October 24. AI used: claude-sonnet-4-5-20250929.

Hey @kmatsumo

That specific field requires access to the payment_terms scope. It’s available for private apps, but not currently for the GraphiQL admin app, which is why you would receive an error when performing this operation through that interface.

You can manually apply the necessary permission to a private app and run your GraphQL query that way while we work on making this scope available to the GraphiQL app.

I hope this helps!

Best,

1 Like