How to Retrieve Payment Terms via Admin API Before Order Creation

Hi!

I’m building a Checkout UI Extension, and I’d like to perform an action if the logged-in B2B customer has payment terms on the checkout page.

So far, I’ve been able to access the GraphQL Admin API from my app backend using an offline access token, but I haven’t been able to find how to query for PaymentTerms.

Is it possible to check if the customer has payment terms before a draft order or order is created?
Could you please let me know how to retrieve this information via the Admin API or anyother APIs such as Checkout API ?

1 Like

Hey @S_W

I’ll help craft a response for the forum post about retrieving payment terms via Admin API before order creation. Let me first check the style guide to ensure my response follows the appropriate tone and format.

Yes, it is possible. When a company has payment terms configured, that will be the only payment option available to them at checkout.

With this in mind, you can access this information directly in your Checkout UI Extension by using the useSelectedPaymentOptions hook. When payment terms are applied, the selected option will show up as a deferred payment.

Hi @KyleG-Shopify

Thank you very much for replying to my question!
The information you shared is very helpful!

Before reading your comment today, I had found and used the paymentTermsTemplate field in the companyLocation query.
(companyLocation - GraphQL Admin)
But thanks to your explanation, I now understand that I don’t need to use it at all—thank you!

1 Like