Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Access Denied Response

Access Denied Response

joeyexecutive
Visitor
2 0 0

I am utilizing the giftcards API to create giftcards

 

When sending a POST to /admin/api/2023-10/gift_cards.json

I receive

{"errors":"Access denied"}

Here are my scopes

joeyexecutive_0-1699340208056.png

My access token is correct. If I change the token in the request I receive an invalid token error.

The POST body is

{"gift_card":{"note":"This is a note","initial_value":"100.00","code":"ABCD EFGH IJKL MNOP","template_suffix":"gift_cards.birthday.liquid"}}
Which is copied directly from the documentation
 
What could be missing?
Replies 4 (4)

Liam
Community Manager
3108 344 889

Hi Joeyexecutive,

 

Are you testing this on a plus store or a plus sandbox development store? It's possible you're seeing this issue as our docs say "the Gift Card resource is available for private apps/ custom apps installed on Shopify Plus stores. 

 

I'll check with the product team if this is expected on non-Plus stores, but if you could confirm the store type that would help in troubleshooting.

 

Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Liam
Community Manager
3108 344 889

Hi Joeyexecutive,

 

I've dug into this a bit further and it seems that access to this API is only available via a beta flag that needs to be enabled by our internal team. The best thing to do is to contact our support via your partner dashboard and request access to the Gift Card API. There's a developer docs update in progress to address this too. 

 

Once you have the beta flag enabled you'll be able to call the gift_cards.json endpoint as expected. 

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ranjan-dopple
Shopify Partner
11 1 6

Hi Liam

Thanks for looking into it. Can this flag be enabled on any shopify store or just Plus stores?

Also do you know when this is coming out of beta? I just reached out to the support team and they said they will forward the request to the API team

Liam
Community Manager
3108 344 889

No update on when this is coming out of beta - connecting with the support team is the best option for now.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog