目次

1.基本情報


指定された契約情報の契約に対し、variantIdで指定された商品を追加する。

追加される商品はShopifyの商品情報が参照される。

項目名 内容
アクション名 addSubscriptionLine
リクエストメソッド POST

2.リクエストに必要な内容


項目名 内容 必須 フォーマット 入力例 備考
subscriptionContractId 定期購買ID はい gid://shopify/SubscriptionContract/*** gid://shopify/SubscriptionContract/1111111111
planId 適用するプランID はい gid://shopify/SellingPlan/*** gid://shopify/SellingPlan/7771652390 プランIDはプラン情報取得APIから取得可能となります。
ここで指定されたプランの割引が適用される仕組みとなります。
quantity 数量 はい 1以上の数値 1
variantId shopify上の商品バリエーションID はい gid://shopify/ProductVariant/*** gid://shopify/ProductVariant/38165164523671
customAttributes 商品のカスタム属性(配列) いいえ Object[] [
{
key : “SpecialProduct”
value : “true”

} ] | lineIdが指定されている場合、この項目は無視され変更前商品のCustomAttributesが引き継がれます。 | | L value | カスタム属性の値 | はい | 1文字以上の文字列 | true | | | L key | カスタム属性のキー名 | はい | 1文字以上の文字列 | SpecialProduct | | | subscriptionLine | 追加商品 | はい | Object | { productId : gid://shopify/Product/6182307954839 variantId : gid://shopify/ProductVariant/38165164523671 title : “タイトル” variantTitle: “バリエーションタイトル” quantity : 1 currentPriceAmount : 1000 lineDiscountedPriceCurrencyCode: “JPY” lineId : null } | | | L lineId | 契約商品のShopify管理ID | はい | gid://shopify/SubscriptionLine/*** またはnull | gid://shopify/SubscriptionLine/123456789 | 指定した場合、商品の変更時の Flow トリガーが実行されます。 商品変更処理を「商品追加API→商品削除API」の組み合わせで実現する場合に限り、指定してください。

※上記商品変更処理は現在非推奨となっており、商品を変更したい場合は 商品変更API をご利用ください。 | | L variantId | shopify上の商品バリエーションID | はい | gid://shopify/ProductVariant/*** | gid://shopify/ProductVariant/38165164523671 | | | L quantity | 数量 | はい | 1以上の数値 | 1 | | | L customAttributes | 商品のカスタム属性(配列) | いいえ | Object[] | [ { key : “SpecialProduct” value : “true” } ] | lineIdが指定されている場合、この項目は無視され変更前商品のCustomAttributesが引き継がれます。 | | L key | カスタム属性のキー名 | はい | 1文字以上の文字列 | SpecialProduct | | | L value | カスタム属性の値 | はい | 1文字以上の文字列 | true | | | L productId | 商品ID | はい | gid://shopify/Product/*** | gid://shopify/Product/6182307954839 | | | L title | 契約商品として設定したい商品名 | はい | 文字列 | タイトル | | | L variantTitle | バリエーションタイトル | はい | 文字列 | バリエーションタイトル | | | L onlineStorePreviewUrl | 商品画像URL | いいえ | URL | https://*** | | | L variantImage | バリエーション画像URL | いいえ | URL | null | https://*** | | | L currentPriceAmount | 商品価格 | はい | 0以上の数値 | 1000 | | | L currentPriceCurrencyCode | 通貨 | はい | CurrencyCode | JPY | | | L lineDiscountedPriceAmount | ディスカウントを反映した商品小計 | はい | 0以上の数値 | 1000 | | | L lineDiscountedPriceCurrencyCode | 通貨 | はい | CurrencyCode | JPY | | | L sku | SKU | いいえ | 文字列 | | 商品のSKUを入力してください |

3.レスポンス内容


変更後の契約内の商品情報がJSONデータで返却されます。

■正常時レスポンス

| --- | --- | --- |

■異常時レスポンス

| --- | --- | --- |