New Shopify Certification now available: Liquid Storefronts for Theme Developers

NET-30 terms in GraphQL draftOrderCreate

Solved
bbarr
Shopify Partner
32 4 9

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

Accepted Solution (1)
bbarr
Shopify Partner
32 4 9

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.

View solution in original post

Reply 1 (1)
bbarr
Shopify Partner
32 4 9

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.