允许应用重复向商店收费-appSubscriptionCreate mutation

允许应用重复向商店收取功能或服务费用。


在本页面


互动范例

这是一个示例变异查询。使用下面的嵌入式交互式工具来编辑查询。

mutation appSubscriptionCreate($name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(name: $name, lineItems: $lineItems, returnUrl: $returnUrl) {
  1. <font style="color:#1F61A0;">appSubscription</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">confirmationUrl</font>
  5. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  6. <font style="color:#1F61A0;">field</font>
  7. <font style="color:#1F61A0;">message</font>
  8. <font style="color:#555555;">}</font>
} }

变量:

{ “name”: “placeholder”, “lineItems”: [
  1. <font style="color:#555555;">{</font>
  2. <font style="color:#8B2BB9;">"plan"</font><font style="color:#555555;">:</font> <font style="color:#555555;">{}</font>
  3. <font style="color:#555555;">}</font>
], “returnUrl”: “placeholder” }

参数

参数 描述
lineItems
[[AppSubscriptionLineItemInput!]!](https://shopify.dev/docs/admin-api/graphql/reference/billing/appsubscriptionlineiteminput) 必需的
将计划附加到应用程序订阅。
name
[String!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

必需的
应用订阅的名称。
returnUrl
[URL!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#url-2021-01)

必需的
批准应用订阅后,重定向商户的URL。
test
[Boolean](https://shopify.dev/docs/admin-api/graphql/reference/scalar#boolean-2021-01)
指定应用程序订阅是否为测试交易。默认值为false。
trialDays
[Int](https://shopify.dev/docs/admin-api/graphql/reference/scalar#int-2021-01)
免费试用的天数。

AppSubscriptionLineItemInput字段

  • plan[AppPlanInput!](https://shopify.dev/docs/admin-api/graphql/reference/billing/appplaninput)必需的
    定义应用程序订阅的定价模型。

返回字段

  • appSubscription[AppSubscription](https://shopify.dev/docs/admin-api/graphql/reference/billing/appsubscription)
    新创建的应用订阅。
  • ConfirmationUrl[URL](https://shopify.dev/docs/admin-api/graphql/reference/scalar#url-2021-01)
    商家批准或拒绝应用订阅的网址。
  • userErrors[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror)
    执行突变时发生的错误列表。