Graphql Request: see if the shop has activated Store Credit Accounts for their customers

If not already possible (searched the docs, didn’t find anything)

Can we get a flag in the shop object or wherever relevant indicating if the shop has this setting turned on?

It’s essential for apps that integrate with this feature!

This can be an approach but cant guarantee in case not a single store credit had been issues:
query {
customers(first: 10) {
nodes {
storeCreditAccounts(first: 1) {
edges {
node {
id
balance { amount currencyCode }
}
}
}
}
}
}

if this response in empty then should mean that store credits is in use.

I have not tried but logically this can be an option.

other way is to create a meta data and and ask customer to set the store credit value to true.

Hi @Ankit_Shrivastava

The solution you propose does not work with the use-case that I’m requesting because it’s to brittle.

A store that allows Store credit might not have a single customer that currently holds any store credit - which would be true for a store that just toggled the setting ON.

Additionally even if they had store credit enabled for a long time - requesting some customers to check if they have store credit it’s a random approach.

Hey @Muchisx :waving_hand: - you’re correct that there’s not currently an easy way to confirm directly if a shop has store credit enabled other than the workaround that @Ankit_Shrivastava shared.

That said, I’ll look into this on my end to see if this is on our roadmap and at the very least put through a feature request for you, since I do get where you’re coming from when you mention that it’s essential for sure.

I’ll loop back with you here once I have more info on my end :slight_smile:

1 Like