概要
APIリファレンス
指定された契約情報の契約に商品を追加する。
項目名 | 内容 |
---|---|
アクション名 | addSubscriptionLine |
リクエストメソッド | POST |
項目名 | 内容 | 入力例 | 備考 |
---|---|---|---|
subscriptionId | 定期購買ID | gid://shopify/SubscriptionContract/1111111111 | |
subscriptionLine | 追加商品 | ||
(JSON形式) | { | ||
productId : gid://shopify/Product/6182307954839 | |||
variantId : gid://shopify/ProductVariant/38165164523671 | |||
title : タイトル | |||
quantity : 1 | |||
currentPriceAmount : 1000 | |||
lineId : NULL | |||
} | productId : | ||
shopify上の商品ID | |||
variantId : | |||
shopify上の商品バリエーションID | |||
title : | |||
契約商品として設定したい商品名 | |||
quantity : | |||
数量 | |||
currentPriceAmount : | |||
契約金額 | |||
lineId : | |||
NULL(固定) | |||
planId | 適用するプランID | gid://shopify/SellingPlan/7771652390 | プランIDはプラン情報取得APIから取得可能となります。 |
ここで指定されたプランの割引が適用される仕組みとなります。 | |||
planName | 適用するプラン(割引)名 | プランA |
変更後の契約内の商品情報がJSONデータで返却されます。
■正常時レスポンス
プロパティ | 型 | 説明 |
---|---|---|
array() | array | 更新後の契約商品一覧 |
L id | number | 定期購買アプリ内の契約商品管理ID |
L applicationId | number | 定期購買アプリ内での定期購買契約管理ID |
L productId | string | null |
L variantId | string | null |
L variantImage | string | null |
L title | string | タイトル |
L variantTitle | string | null |
L sku | string | null |
L quantity | number | 数量 |
L lineDiscountedPriceAmount | float | 商品価格(廃止) |
L lineDiscountedPriceCurrencyCode | string | 商品価格の通貨単位 |
L createdAt | timestamp | 登録日時 |
L updatedAt | timestamp | 更新日時 |
L onlineStorePreviewUrl | string | 商品URL |
L currentPriceAmount | float | 商品価格 |
L currentPriceCurrencyCode | string | 商品価格の通貨単位 |
L lineId | string | 契約商品のShopify管理ID |
L sellingPlanId | string | null |
L sellingPlanName | string | null |
■異常時レスポンス
ステータスコード | 型 | エラーメッセージ |
---|---|---|
400 | string | 定期購買はすでに解約されています |
400 | string | この定期購買の契約種別では許可されていない操作です |
404 | string | 定期購買が存在しません |
404 | string | ストアが存在しません |
500 | string | 内部エラーが発生しています |