セール商品更新
PATCH
/bargain/{bargain_id}/products/{bargain_product_id}
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/bargain/example/products/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"targetDivision":"1","targetId":"string","division":"1","value":"1234567890"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/bargain/example/products/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "targetDivision": "1", "targetId": "string", "division": "1", "value": "1234567890" }'セール商品情報を更新します。
対象プラン
- スタンダード
- プレミアム
- プレミアムプラス
- フードビジネス
- リテールビジネス
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”bargain_id
required
string
セールID
※ ユーザーアクセストークンを利用する場合、ユーザーの所属する店舗で実施されるセールIDを指定してください。
bargain_product_id
required
string
セール商品ID:セールID、対象区分、対象ID の3つの値によって定まる一意なID
Request Body
Section titled “Request Body”Media typeapplication/json
object
targetDivision
対象区分
1:カテゴリー, 2:商品, 3:グループコード
string
targetId
対象ID
カテゴリーID, 商品ID, グループコードのいずれか
※ ユーザーアクセストークンを利用する場合で商品IDを指定する場合、ユーザーの所属する店舗で販売している商品IDを指定してください。
string
division
割引区分
1:割引 2:値引 3:価格指定
string
value
値
割引、値引き、価格指定の値
string format: int
Example
{ "targetDivision": "1", "targetId": "string", "division": "1", "value": "1234567890"}Responses
Section titled “Responses”取得成功
Media typeapplication/json
object
bargainProductId
セール商品ID:セールID、対象区分、対象ID の3つの値によって定まる一意なID
string
bargainId
セールID
string
targetDivision
1:カテゴリー, 2:商品, 3:グループコード
string
targetId
カテゴリーID, 商品ID, グループコードのいずれか
string
division
1:割引 2:値引 3:価格指定
string
value
割引、値引き、価格指定の値
string
insDateTime
登録時・更新時の日時
string
updDateTime
登録時・更新時の日時
string
Example
{ "bargainProductId": "string", "bargainId": "string", "targetDivision": "string", "targetId": "string", "division": "string", "value": "string", "insDateTime": "string", "updDateTime": "string"}- 指定されたidとbargainProductIdの組み合わせがおかしい場合
- targetDivision=1かつtargetIdに一致する部門が存在しない場合
- targetDivision=2かつtargetIdに一致する商品が存在しない場合
- targetDivision=3かつtargetIdに一致するグループコードの商品が存在しない場合
- 同一データの重複している場合
- 割引率のチェックエラー
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
{ "type": "about:blank", "title": "Bad Request", "detail": "bargainId:171 指定されたセール商品は異なるセールに属しています", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "targetId:[171] 部門IDは存在しません", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "targetId:[171] 商品IDは存在しません", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "targetId:[171] 指定されたグループコードの商品は存在しません", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "bargainProductId:[171] 同じtargetDivision、targetIdのレコードが存在します", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "division=1 の場合、valueは[1-100]を指定して下さい", "status": 400}