Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to filter Customer Metafields on namespace and key #178

Open
hastinc opened this issue Mar 21, 2022 · 0 comments
Open

Unable to filter Customer Metafields on namespace and key #178

hastinc opened this issue Mar 21, 2022 · 0 comments

Comments

@hastinc
Copy link

hastinc commented Mar 21, 2022

Hi All,

I'm trying to find all metafields for a Customer that has a specific namespace and key
Basically, this cURL request

curl --location --request GET 'https://{{store_domain.com}}/admin/api/2022-01/metafields.json?namespace={{namespace}}&key={{key}}' \
--header 'X-Shopify-Access-Token: {{access_token}}'

In my code I'm using the Customer.ListMetafields method like so:

metafield, err := client.Customer.ListMetafields(shopifyID, goshopify.Metafield{
		Namespace: "{{namespace}}",
		Key:       "{{key}}",
	})
if err != nil {
	lib.CheckError("failed to get Shopify metafield", err)
}

But instead of getting a filtered list of Metafields I'm getting all of the customer's metafields. Is this an issue with the package or am I just doing something silly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant