A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi all,
I am trying to create a draft order that is due in 30 days.
With the following request/data:
mutation CreateOrder($input: DraftOrderInput!) {
draftOrderCreate(input: $input) {
draftOrder {
id
}
userErrors {
field
message
}
}
}
-------------------------------
{
input: {
customerId,
lineItems: [ { variantId, quantity: 1 } ],
paymentTerms: {
paymentSchedules: {
dueAt: "2022-04-23T00:00:00Z"
}
}
}
}
I get the following error:
{"draftOrderCreate":{"draftOrder":null,"userErrors":[{"field":null,"message":"Payment terms template id can not be empty."}]}}
Anyone have an idea how to either create these templates or else otherwise create a net-30 order using the API?
Thanks,
Brendan
Solved! Go to the solution
This is an accepted solution.
Solved this after hours of fruitless Googling and forum/Slack search. Apparently there are a bunch of pre-made payment term templates that you can view using the following query:
query {
paymentTermsTemplates {
id
dueInDays
}
}
This will spit out a bunch of options that hopefully fit your use case.
We really shouldn't have to work this hard. Documentation CAN be empowering, both contextual and thorough. Stripe's docs are proof that this is possible - Shopify's is not.
This is an accepted solution.
Solved this after hours of fruitless Googling and forum/Slack search. Apparently there are a bunch of pre-made payment term templates that you can view using the following query:
query {
paymentTermsTemplates {
id
dueInDays
}
}
This will spit out a bunch of options that hopefully fit your use case.
We really shouldn't have to work this hard. Documentation CAN be empowering, both contextual and thorough. Stripe's docs are proof that this is possible - Shopify's is not.