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

Shopify Checkout API Ending April 1, 2025 #127

Open
siebird opened this issue Dec 4, 2024 · 16 comments
Open

Shopify Checkout API Ending April 1, 2025 #127

siebird opened this issue Dec 4, 2024 · 16 comments

Comments

@siebird
Copy link

siebird commented Dec 4, 2024

We just got a notice from Shopify that they will end support for the storefront and admin checkout API that this plugin uses:

Migrate to the Storefront Cart API

Are there plans to migrate this plugin to their new API before April?

Copy link

linear bot commented Dec 4, 2024

@fbnntt
Copy link

fbnntt commented Dec 12, 2024

Any updates re this?

@lukeholder
Copy link
Member

@fbnntt I think you are referring to the Checkout API, the plugin uses the admin REST API to get and sync the products so I think we are unaffected? Can you point out specifically what we are doing in the API that is being deprecated?

@smcyr
Copy link

smcyr commented Dec 17, 2024

@lukeholder It's hard to find info on that, but everywhere on the admin REST API, there is a message that it's deprecated since October 1, 2024 (https://shopify.dev/docs/api/admin-rest).
And starting April 1, 2025, all new apps created must be GraphQL:
https://shopify.dev/changelog/starting-april-2025-new-public-apps-submitted-to-shopify-app-store-must-use-graphql
So, ideally, the Craft Shopify plugin should be updated to use the GraphQL api before April, or otherwise, it won't work for people creating new apps.

@lukeholder
Copy link
Member

lukeholder commented Dec 18, 2024

@smcyr Thanks, I see the warning in the docs for admin-rest. We will get this plugin upgraded before the cut-off date.

@rjgux
Copy link

rjgux commented Feb 3, 2025

Is there any updates on this one? Shopify is starting to get loud on the deprecations!

@nfourtythree
Copy link
Contributor

Hi @rjgux

This is something that we are currently working on, we have a draft PR for this.

It is currently work-in-progress, we will make sure to update this issue with any progress.

Thanks!

@nfourtythree nfourtythree added the Feature label Feb 4, 2025 — with Linear
@timkelty timkelty removed the Plugins → Shopify For Linear sync label Feb 4, 2025
@johndwells
Copy link

Hey guys, really happy to see there's been some recent movement on this with the draft PR. Thank you!

I'd like to point out that we are now just a little over 6 weeks out from when this API is going to stop working. We as site owners need a reasonable amount of time to run (and test) the necessary upgrades.

But while this Issue remains open, we don't know what a "reasonable amount of time" is. Will there be a clear a upgrade path? Will there be breaking changes?

All of this is to say, I really hope to see this issue addressed ASAP. If not, it puts all of our own sites (and relationships with clients) at risk.

🙏

@smcyr
Copy link

smcyr commented Feb 11, 2025

I'd like to point out that we are now just a little over 6 weeks out from when this API is going to stop working.

From what I can read from Shopify, the API will still be working for existing apps on April 1st. It's only new Shopify organizations that won't be able to create new custom apps using the REST API:
https://shopify.dev/changelog/starting-april-2025-new-public-apps-submitted-to-shopify-app-store-must-use-graphql
https://shopify.dev/changelog/deprecation-timelines-related-to-new-graphql-product-apis

Custom apps built on REST that do not need to support more than 100 variants can continue to use the deprecated REST product APIs, however it is important to note:
-Developers should expect that the GraphQL API will be the only supported API over the long term and will be made aware of these timelines as they become available.
-The deprecated REST product APIs are in maintenance mode; all new features and support will be built only for the new GraphQL product APIs.
-Any merchant using custom apps built with these deprecated APIs will not be able to increase their variant limit past 100.

@johndwells
Copy link

@smcyr I appreciate the clarification, thank you.

However I don't think it's a tenable solution so say that this plugin works, as long as you integrate it by April 1. It's tied to a deprecated API, which has some important limitations that affect other features of this plugin (e.g. #90).

I also don't think what this issue is asking for is unreasonable, nor is my ask that it be addressed in a timely manner.

@nfourtythree
Copy link
Contributor

Hi All

Thank you for the messages.

We understand that this is a time-sensitive issue/update and are working to get something out as soon as we can. We would like to get a beta out at the end of this week/beginning of next. It would be great to get feedback on people updating the plugin.

We are trying to negate breaking changes where we can, although there are some discrepancies between the data the REST and GQL APIs return. With how people use the plugin in the wild a beta could be a great place to learn where we can make changes to ensure the transition is as seamless as possible.

Please let us know if you have any other questions or specific queries.

Thanks!

@stephanedemotte
Copy link

Hello @nfourtythree , do you think we’re going to have GraphQL support in the next 6.x release ? thank !

@nfourtythree
Copy link
Contributor

Hi @stephanedemotte

Thank you for your question.

Full GraphQL support is something on our list/radar: #49

We are just concentrating on completing the conversion of the integration with the Shopify API so that it works for everyone.

Once that is done we will have a clear path for new features. With that, it will unlikely make it into 6.0 but we can look at it for 6.1.

Thanks

@TGriffiths88
Copy link

Hey guys, are there any updates on this at all?

@stephanedemotte
Copy link

stephanedemotte commented Feb 25, 2025

@TGriffiths88 feedme + element api is the way, for me :)

    'api/products.json' => function() {
      return [
        'cache' => false,
        'one' => true,
        'elementType' => Entry::class,
        'transformer' => function() {
          $client = new Client();
          $response = $client->get("https://" . App::env('SHOPIFY_HOSTNAME') . "/admin/api/" . App::env('SHOPIFY_VERSION') . "/products.json", [
            'headers' => [ 'X-Shopify-Access-Token' => App::env('SHOPIFY_TOKEN'), 'Content-Type' => 'application/json'],
            'query' => [ 'limit' => 1, 'page_info' => Craft::$app->request->getParam('page_info', null)],
          ]);
          $data = json_decode($response->getBody()->getContents(), true);
          $pagination = $response->getHeader('Link');
          $next = null;
          if (!empty($pagination)) {
            $links = explode(',', $pagination[0]);
            foreach ($links as $link) {
              if (strpos($link, 'rel="next"') !== false) {
                preg_match('/page_info=([^&>]+)/', $link, $matches);
                $next = $matches[1] ?? null;
              } 
            }
          }
          $products = [];
          foreach($data['products'] as $key => $p):
            $products[] = [
              'id' => $p['id'],
              'title' => $p['title'],
              'media' => $p['image']['src'],
              'raw' => json_encode($p)
            ];
          endforeach;
          return [
            'next' => App::env('PRIMARY_SITE_URL') . '/api/products.json?page_info=' . $next,
            'products' => $products ?? [],
          ];
        },
      ];
    },

@nfourtythree
Copy link
Contributor

Hi All

We are pleased to say that we have just pushed a beta of the new version of the Shopify plugin (6.0.0-beta.1). This has all the changes for moving away from the Admin REST API and to the Admin GraphQL API.

We have updated the README with the new details (and are continuing to improve on this) please pay careful attention to the upgrading section which details differences that will be of note for your projects.

To get this version, change your craftcms/shopify requirement in your project's composer.json to:

"require": {
  "craftcms/shopify": "^6.0.0-beta.1",
  "...": "..."
}

Then run composer update.

Looking forward to your feedback on this version! Please let us know if you come up against any issues.

We please ask that if you have any issues related to the new version that you create new issues for them in this repo so we can efficiently track everything.

Thanks!

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

No branches or pull requests

10 participants