Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

NET-30 terms in GraphQL draftOrderCreate

Solved

NET-30 terms in GraphQL draftOrderCreate

bbarr
Shopify Partner
33 4 10

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
33 4 10

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
33 4 10

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.