Credit and Payment Terms
Introduction
A capability of B2B Edition is to set individualized credit restrictions and payment terms per company, and it’s useful to be able to inspect these company details from a storefront perspective.
The GraphQL queries explained here require only a valid Bearer token after a login operation and will return the correct details for the corresponding company.
Fetching Credit Configuration
The companyCreditConfig query can be used to fetch the details of the credit limit or hold applied to the current user’s company.
Example Query and Response:
Query
Response
availableCreditcontains the dollar amount of the company’s limit for PO payment on an order.- When
limitPurchasesis TRUE, the PO payment method will be disabled for any orders exceedingavailableCredit. - When
creditHoldis TRUE, no transactions except invoice payments will be allowed for any of the company’s users.
Note that the available credit value for a company only affects the maximum amount allowed in a single order. Existing orders and open invoices will not affect the availableCredit value returned or the user’s checkout experience for lower amounts.
Fetching Payment Terms
The companyPaymentTerms query can be used to fetch details of a company’s payment terms.
Example Query and Response:
Query
Response
isEnabledindicates whether custom payment terms are set for the company. If FALSE, this means the store’s default payment terms will apply.- If custom terms are set for the company,
paymentTermswill return that value. If not, it will return the store’s default terms.
A value of 30 for paymentTerms, for example, indicates Net 30 terms, meaning that the company’s invoices will be due 30 days after they are created.