Credit limit for B2B store

Hi

Is it possible to set up credit limit on the B2B store using any apps, if yes can you share the documentation for implementing the same?

Thanks,

Khasim

2 Likes

Im developing this using graphql

---------------run.graphql file-------------

query {
company(id: “gid://shopify/Company/abc”) {
metafield(namespace: “b2b”, key: “credit_limit_remaining”) {
value
}
}
}
And changes “Input” to “Company” in
----------schema.graphql------------------

schema {
query: Company
mutation: MutationRoot
}

Trying to access the value in run.js

const credit_limit = Number(input.company.metafield?.value);
But errorCommand failed with exit code 1: npm exec – graphql-code-generator --config package.json
[FAILED] GraphQL Document Validation failed with 1 errors;
[FAILED] Error 0: Cannot query field “company” on type “Company”.
[FAILED] at C:/Users/Khasim/shopify-functions/lucrative-consumer-app/extensions/cart-checkout-validatio
n/src/run.graphql:2:3

Any idea how to resolve this error?

Thanks
Khasim

I am curious about this as well!! It shocks me that Shopify doesn’t have this as a built in feature. Has anyone found a solution? Even using an app would be fine if not a crazy monthly charge.

Yes! I launched an app specifically to apply credit limits for B2B - https://apps.shopify.com/upro-b2b-and-wholesale-upload-csv-order

Yes! I launched an app specifically to apply credit limits for B2B - https://apps.shopify.com/upro-b2b-and-wholesale-upload-csv-order
Regarding the monthly charge, it’s a new app and we’re still early - would love to understand more and make the pricing fairer.

Hi @Khasim1,
I saw your question about B2B spending limits. In DC Order Limits, customer purchase limits can set a spending cap per customer, and then you can reset that tracking on a schedule.

Setup:

  1. Create a customer purchase limit rule

  2. Set a maximum spending amount instead of a quantity limit

  3. Target customers by tag, for example, your wholesale tier tags

  4. Use Shopify Flow to reset the tracked purchase history each month

Spending is counted across the customer’s orders. If you have multiple tiers, each tier can have its own rule and cap.

Let me know if this setup works for you. I’d be happy to help if you run into anything.