Shopify - How to complete abandoned checkout using Graphql - graphql

I have created abandoned checkout using "checkoutcreate" mutation of the Shopify storefront API. It is successfully created, but how do I mark it as completed using Rest API or Graphql API, I have tried the "checkoutCompleteFree" mutation, but it throws a "Payment Pending" error.
I have tried to mark it from Shopify admin too, but it is not possible from there too, they just give the option to archive.

Related

Fetch Public App Details Using Shopify Storefront API

I have one scenario where I want to access third-party apps/public apps(shopthru) data using Shopify storefront API.
In my case, I am using shopthru app and I want to fetch data about the created campaign, campaign conditions (like discount for specific walletaddress, or POAP NFT).
I want to know if is it possible to get third party app / public app details using shopify storefront API.
This is not possible. Shopify Apps doesn't integrate and extend Shopify Storefront API. You can try to find out what URL of app is by inspecting iframe, pull out accesstoken from your request and using curl try to extract data but this is very hackish and unstable way.
Other option would be to contact App Developer and ask him to expose some endpoints.
If App is changing your store behavior, you can try to fetch data using GraphQL Admin API and find desired details in discounts object:
https://shopify.dev/apps/discounts/existing
https://shopify.dev/api/admin-graphql/2022-10/queries/codeDiscountNode

Shopify Graphql API - draftOrderCreate redirect to Checkout with Discount Code Field

If you are familiar with Shopify draftOrderCreate API, you know that when retrieving the invoice_url via the graphql mutation, it will redirect you to the checkout page but there will be no DISCOUNT CODE Field, and Shopify docs are clear with this, but upon checking some apps (https://apps.shopify.com/draft-helper) it is possible, but on the said app, you will manually generate the checkout link.
Here's a photo of what that app is doing
I am wondering how do i integrate this automatically via graphql. When checking the Console (Network) it seems like he is only passing the draft order id as payload.
When you create a Draft Order, you can provide a discount. So if you do that, and then send the invoice, the discount should be applied correctly.

Paypal rest api get order details for an order palced with nvp api

I have a Magento2 shop with default checkout module that is placing orders using nvp api. I need to later get the order from paypal and do some action based on its status but from the rest api (
/v2/checkout/orders/{id}) i only get results for orders created with the same rest api, not the ones that are placed during checkout (with nvp api).
I have configured a sandbox account on paypal and the business account that is used for nvp api calls have access to the app created in paypal for rest.
Is this mix of api calls allowed at paypal? Or it might be a problem with the paypal sandbox configuration?
Thanks
You wouldn't use the v2/orders API for this, as orders are only used for creating transactions, not referencing them after the fact.
For later referencing completed transactions you would use the v2/payments API, particularly a 'get' for a completed capture. Here is the documentation.
Whether this works for transactions made with the NVP API is not something I've tested; if not, you would need the NVP GetTransactionDetails.

Shopify Storefront API 2020-10 (latest) can't fetch quantityAvailable (GraphQL)

For the first time I'm working with Shopify Storefront API (v. 2020-10, latest) and trying out GraphQL (I'm used to REST).
I'm able to get all the products, but if I add the field "quantityAvailable" an error occur:
Field 'quantityAvailable' doesn't exist on type 'ProductVariant'
I'm following the docs where the field is listed,
can you help me understand what am I doing wrong?
Edit #1
I've already enabled "Read inventory of products and their variants" in Storefront API Permissions.
Edit #2
I'm sending a POST request to https://{my-shopify-website}/api/graphql attaching content-type and X-Shopify-Storefront-Access-Token as header
Using the /api/2020-10/graphql end-point allows the usage of quantityAvailable property, but using the unstable end-point /api/graphql doesn't.
This seems more like a Shopify docs or API bug/issue, but the solution is to use the specific version end-point (/api/2020-10/graphql) instead of the unstable one.

Google Checkout - Force callback URL API post

I'm building a Magento cart and we set up Google Checkout and went live and unfortunately I was unaware of the 'API Callback URL' setting on the Google side and didn't have that filled in until now. So now we have a few orders that went through and I need to get them into my cart system so I'm wondering if there's a way to force post existing orders across to my system?
See this document for various ways to retrieve Googe Checkout notifications.
http://code.google.com/apis/checkout/developer/Google_Checkout_Beta_Polling_API.html
In your case try the Polling API or the Notification History API.

Resources