You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过API调用卸载Shopify店铺中的自定义应用

通过API卸载Shopify自定义应用的正确方式

问题概述

尝试通过API卸载Shopify店铺内的自定义应用,已测试以下请求地址均未成功:

  • https://${shop}/admin/oauth/access_scopes/${appId}.json
  • https://${shop}/admin/api/2023-01/applications/${appId}/uninstall.json
  • https://${shop}/admin/api/2023-01/app/installations/${appId}.json
  • https://${shop}/admin/api/2021-09/app/installations/current.json
  • https://${apiKey}:${apiSecret}@${shop}/admin/api/2021-09/applications/${appId}.json
  • https://${shop}/admin/api/2023-01/applications_installed/${appId}.json
  • https://${shop}/admin/api/2021-09/applications/${appId}/api_uninstall.json

正确实现方案

Shopify Admin API提供了标准的应用卸载接口,需严格遵循以下规范:

1. 标准接口地址

使用DELETE方法调用指定API版本的应用安装删除接口,格式如下:

DELETE https://${shop}/admin/api/{api_version}/app/installations/${appId}.json

示例(采用2024-01稳定版本):

DELETE https://your-store.myshopify.com/admin/api/2024-01/app/installations/987654321.json

2. 认证要求

  • 必须使用OAuth 2.0访问令牌进行请求头认证,令牌需包含write_apps权限
  • 禁止直接使用API Key+Secret拼接的方式认证,这类认证方式已被Shopify废弃

3. 卸载当前应用的简化接口

如果是应用自身发起卸载请求,可使用无需指定appId的简化接口:

DELETE https://${shop}/admin/api/{api_version}/app/installations/current.json

4. 常见失败原因排查

之前的请求未成功,大概率是以下问题导致:

  • 使用了错误的HTTP请求方法(比如用GET/POST而非DELETE)
  • 访问令牌缺少write_apps权限
  • 采用了已废弃的API版本或错误的接口路径
  • 认证方式不符合Shopify当前规范

内容的提问来源于stack exchange,提问作者Manish Srivastava

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 12:52:47