Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hi,
I am facing issues with the "Checkout API". I have a sales channel named "Online Store" and also have access to "write_checkouts" scope from the merchant but still facing issues with integrating the "Checkout API". The error that i am getting by integrating the " Checkout API" is
{
"errors": "[API] This action requires merchant approval for write_checkouts scope."
}
I am for now integrating the API on POSTMAN with the POST request
url: https://{api_key}:{password}@{store_name}.myshopify.com/admin/checkouts.json
and in the headers section
storefrontAccessToken: {storefrontAccessToken}
contentType : application/json
Also, i have checked for the scopes that can be accessed by the store through the API "/admin/oauth/access_scopes.json" and in the response i am getting that i have access to "write_checkouts" scope.
Can you guide us as to where are we going wrong. Waiting in anticipation for your reply.
Hi Rix,
Have you made sure that your app is a sales channel and that it is a public app? Otherwise you may also want to keep an eye out on this thread as it gets updated - might be related.
Best wishes!
Hi Karl,
Yeah my app is a sales channel named "Online Store". I am not sure about my app being a private app or a public app. Is it something related?
Also, if it is not a public app then how do we need to go about making it a public app?
Regards,
Nimita
The Online Store is the default sales channel when you have a store. However, a sales channel app is not about the online store. It is anything like a POS app, eBay or Etsy, in game purchases and anything you can think of elsewhere where you can sell your goods.
The Checkout API will work for such sales channels that you interact with or create, but will not be capable of completing checkouts on your default Online Store sales channel - that is only possible via Storefront API up to a certain degree (the last checkout step is always a completion step URI which cannot be completed via API).
Only public apps are able to use the Sales Channel SDK and thus the Checkout API. A public app need tot be published though.
Best wishes!
Hi Karl,
We have added the "POS" sales channel in our store. But the issue still persists.
I am for now integrating the API on POSTMAN with the POST request below :
URL : https://{api_key}:{password}@{store_name}.myshopify.com/admin/checkouts.json
And in the headers section :
storefrontAccessToken: {storefrontAccessToken}
contentType : application/json
and the Body section contains JSON as follows:
{
"checkout":{
"email": "[email protected]",
"line_items": [{
"variant_id": 19782798344281,
"quantity": 1
}],
"shipping_address": {
"first_name": "John",
"last_name": "Smith",
"address1": "126 York St.",
"city": "Ottawa",
"province_code": "ON",
"country_code": "CA",
"phone": "(123)456-7890",
"zip": "K1N 5T5"
}
}
}
The response that i am receiving for the above request is the Log In page of the store in HTML format.
I have also attached the screenshots of the response that i am receiving.
Please let me know as how to proceed with the above concerned issue. Plus, do let me know whether there are any additional changes that needs to be taken care of while integrating the sales channel.
Regards,
Nimita
Hi Karl,
We have integrated the "POS" channel in our store. But the issue still persists.
I am for now integrating the API on POSTMAN with the POST request below:
url: https://{api_key}:{password}@{store_name}.myshopify.com/admin/checkouts.json
and in the headers section
storefrontAccessToken: {storefrontAccessToken}
contentType : application/json
and JSON body as:
{
"checkout":{
"email": "[email protected]",
"line_items": [{
"variant_id": 19782798344281,
"quantity": 1
}],
"shipping_address": {
"first_name": "John",
"last_name": "Smith",
"address1": "126 York St.",
"city": "Ottawa",
"province_code": "ON",
"country_code": "CA",
"phone": "(123)456-7890",
"zip": "K1N 5T5"
}
}
}
The response that i am receiving from the above POST request is the Log In page of the store in HTML format.
I have also attached the screenshots of the response that i am receiving.
Please let me know how to proceed with the above concerned issue. Also, do let me know whether we need to make any additional changes in the settings after integrating the "POS" sales channel.
Regards,
Nimita
Hi Karl,
We have integrated the "POS" channel in our store. But the issue still persists.
I am for now integrating the API on POSTMAN with the POST request below:
url: https://{api_key}:{password}@{store_name}.myshopify.com/admin/checkouts.json
and in the headers section
storefrontAccessToken: {storefrontAccessToken}
contentType : application/json
The response that i am receiving from the above POST request is the Log In page of the store in HTML format.
I have also attached the screenshots of the response that i am receiving.
Please let me know how to proceed with the above concerned issue. Also, do let me know whether we need to make any additional changes in the settings after integrating the "POS" sales channel.
Regards,
Nimita
You are getting the login page because you are sending cookies with your POST. You need to disable cookies from Postman when doing any kind of POST requests against the Shopify API.
Hi Karl,
I am back to square one with the issue. I am again receiving the "merchant approval issue with checkout API even though i have integrated the "POS" sales channel. Also, in POSTMAN there are cookies being sent along with the checkout API POST request.
Please let me know whether there are any additional settings that are to be done once the "POS" sales channel is integrated in the Shopify store
POST should not send cookies. You need to disable cookies on POST, clear them or however it is done using Postman - I don't use Postman so can't tell you specifically how to disable cookies.
Alternatively use Insomnia where disabling cookies is easy (plus it's way sweeter for doing GraphQL stuff).
As for other issues with "merchant approval" I can't help. Sorry. Maybe someone else or Shopify can voice their expertise on that one.
Hi Karl,
There are no cookies being sent along with the Checkout API POST request in POSTMAN.
Regards,
Nimita