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.

@GrahamS

Hey, sorry for the late reply!

Thank you, it is not giving me the error after adding the scope.

(Although I’m encountering another error, I’ll try figure it out my self for now)

Would be nice if the documents were a bit more clearer so I know which scopes are needed.

Or I might have not reading it properly…

Thanks once again.