如何使用 APP/API 添加 Shopify 放弃结帐条目

发布于 2025-01-14 07:18:13 字数 325 浏览 4 评论 0原文

有什么方法可以使用 Shopify Rest API 通过 APP 添加废弃的结帐条目吗? 目前我只能访问这 2 个 API ,计数并列出。 输入图片此处描述

Is there any way I can add abandoned checkout entries through APP using the Shopify Rest API?
Currently I can only access these 2 APIs, count and list.
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

路弥 2025-01-21 07:18:13

您无法使用 Rest API 创建放弃结帐,但可以借助 Shopify Storefront Graphql API 来执行此操作。您可以使用以下突变来创建废弃的购物车。

mutation createAbondonedCart{
  checkoutCreate(
    input: {email: "[email protected]", shippingAddress: {address1: "Abc", address2: "Xyz", city: "Mumbai", company: "TEST", country: "India", firstName: "John", lastName: "Doe", phone: "000000000", province: "Maharashtra", zip: "400025"}, note: "Handle with Care", lineItems: [{quantity: 10, variantId: "gid://shopify/ProductVariant/56768575857"}]}
  ) {
    checkout {
      id
    }
    checkoutUserErrors {
      code
      field
      message
    }
  }
}

要运行此突变,请通过在商店内创建自定义应用程序或构建销售渠道应用程序来生成 Shopify 店面访问令牌。

对于自定义应用程序,您将需要店面的读写结账权限。

You cannot create abandoned checkout using Rest API, but you can do this with the help of Shopify Storefront Graphql API. You can use the below mutation to create an abandoned cart.

mutation createAbondonedCart{
  checkoutCreate(
    input: {email: "[email protected]", shippingAddress: {address1: "Abc", address2: "Xyz", city: "Mumbai", company: "TEST", country: "India", firstName: "John", lastName: "Doe", phone: "000000000", province: "Maharashtra", zip: "400025"}, note: "Handle with Care", lineItems: [{quantity: 10, variantId: "gid://shopify/ProductVariant/56768575857"}]}
  ) {
    checkout {
      id
    }
    checkoutUserErrors {
      code
      field
      message
    }
  }
}

For running this mutation, generate a Shopify storefront access token by creating a custom app inside the store or by building a sales channel app.

For the custom app, you will need read and write checkout permission of the storefront.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文