[Bug] Payment terms template is invalid

So I’m currently trying to use the companyCreate endpoint.

I’m passing company and companyLocation inputs. Underneath the companyLocation I’m passing the following:

"buyerExperienceConfiguration":{
  "editableShippingAddress":true,
  "paymentTermsTemplateId":"gid://shopify/PaymentTermsTemplate/1"
}

But I’m getting Payment terms template is invalid, I’ve queried the available payment terms templates on the store and it does exist, so what’s going wrong here?

Hi Luke,

Digging into how exactly this field on companyCreate is supposed to be used - in the meantime, if you use the companyLocationUpdate mutation instead which has the same field, does this generate the same error?

Will see what happens with companyLocationUpdate and report back Liam!

Looping back on this - it does’t look like it’s supported. Only a subset of the template types are supported in the buyer experience configuration - we’ll be updating the docs to reflect this.

Any reason for that at all? Doesn’t make much sense when its Shopify that creates these payment templates too!

Hey @Liam-Shopify any news on this one? Just coming back to it again and experiencing this issue, don’t really want to be making additional calls for this if possible!

Definitely feels silly that this isn’t supported in the creation mutation.

Hi @Liam-Shopify I’ve now tested this using companyLocationUpdateand still get the exact same problem.

Please can this be looked at ASAP as this means its impossible to set payment terms via the API.

Variables:

{
  "companyLocationId": "gid://shopify/CompanyLocation/79568109952",
  "input": {
    "buyerExperienceConfiguration": {
      "paymentTermsTemplateId": "gid://shopify/PaymentTermsTemplate/7"
    }
  }
}

------------------------------------------------------------

Response:

{
  "data":{
    "companyLocationUpdate":{
      "userErrors":[
        {
          "field":[
            "input",
            "buyerExperienceConfiguration",
            "paymentTermsTemplateId"
          ],
          "message":"Payment terms template is invalid"
        }
      ]
    }
  },
  "extensions":{
    "cost":{
      "requestedQueryCost":10,
      "actualQueryCost":10,
      "throttleStatus":{
        "maximumAvailable":2000.0,
        "currentlyAvailable":1990,
        "restoreRate":100.0
      }
    }
  }
}

I have ran the following in the GraphiQL app and can confirm the gid does exist:

Query:

{
  paymentTermsTemplates {
    id
    name
  }
}

------------------------------------------------------------

Response:

{
  "data": {
    "paymentTermsTemplates": [
      {
        "id": "gid://shopify/PaymentTermsTemplate/1",
        "name": "Due on receipt"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/9",
        "name": "Due on fulfillment"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/2",
        "name": "Net 7"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/3",
        "name": "Net 15"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/4",
        "name": "Net 30"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/8",
        "name": "Net 45"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/5",
        "name": "Net 60"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/6",
        "name": "Net 90"
      },
      {
        "id": "gid://shopify/PaymentTermsTemplate/7",
        "name": "Fixed"
      }
    ]
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 1,
      "actualQueryCost": 1,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1999,
        "restoreRate": 100
      }
    }
  }
}

Also, the payment terms template I’m trying to set is ‘Fixed’, and this isn’t even an option in the UI. So is there something up with the ‘Fixed’ option?

@Alan_G Are you able to take a look at this? (sorry for the tag!)

Right I tried using gid://shopify/PaymentTermsTemplate/9 instead which represents ‘Due on fulfillment’ and it accepted this.

So there is an issue with Shopify not accepting the following payment terms template:

{
  "id": "gid://shopify/PaymentTermsTemplate/7",
  "name": "Fixed"
}

Can I get some clarification here?

Hey @Luke :waving_hand: - no worries, happy to look into this. Just to confirm on my end, it does look like the Fixed payment template is a valid enum in the API:

Would you happen to have an X-Request-ID from the response headers for the Payment terms template is invaliderror response we sent your way or a request ID from a replication of the call? Definitely can do some digging in the logs and reach out to some folks internally to investigate further.

Hope to hear from you soon.

From my guessing, it seems ‘Fixed’ would rely on a due date being passed, which you would do within draftOrderCreate and that makes sense.

You obviously wouldn’t have a due date for orders taken by a company on a store. So maybe the documentation needs to be made more clearer here.

But I’m also surprised there isn’t an option for something like ‘Immediate payment’ rather than having to wait for fulfillment with ‘Due on fulfillment’.

Thanks for following up @Luke , looking at the docs, you would be correct.

The Fixed template does require a payment schedule to be set up with a dueAt timestamp when it’s created through paymentTermsCreate, so I’m wondering if the same logic is applying here on separate mutation. During paymentTermsCreate, if you pass the Fixed template without that, the API returns a validation error.

That said, it doesn’t look like you can pass a dueAt value through the buyer config input there. If you’re open to sharing the full mutation/variables you used for the test or a request ID from the response headers I’m definitely more than happy to investigate this further - hope to speak soon!