仕入先商品登録
POST
/suppliers/{supplier_id}/products
const url = 'https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/suppliers/example/products';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"categoryId":"123456789","productId":"123456789012345"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.smaregi.dev/TARGET-CONTRACT-ID/pos/suppliers/example/products \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "categoryId": "123456789", "productId": "123456789012345" }'仕入先商品を登録します。
対象プラン
- スタンダード
- プレミアム
- プレミアムプラス
- フードビジネス
- リテールビジネス
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”supplier_id
required
string
仕入先ID
Request Body
Section titled “Request Body”Media typeapplication/json
object
categoryId
部門ID
部門ID:仕入先で取り扱っている部門のID
※部門IDと商品IDのいずれか必須。(複数指定不可。複数設定された場合はエラー)
string format: int
productId
商品ID
商品ID:仕入先で取り扱っている商品のID
※部門IDと商品IDのいずれか必須。(複数指定不可。複数設定された場合はエラー)
string format: int
Example
{ "categoryId": "123456789", "productId": "123456789012345"}Responses
Section titled “Responses”更新成功
Media typeapplication/json
object
supplierId
仕入先ID
string
categoryId
部門ID:仕入先で取り扱っている部門のID。
商品IDで登録された仕入先商品の場合、nullを設定。
string
productId
商品ID:仕入先で取り扱っている商品のID。
部門IDで登録された仕入先商品の場合、nullを設定。
string
insDateTime
作成日時:登録時の日時。[YYYY-MM-DDThh:mm:ssTZD]
string
Example
{ "supplierId": "string", "categoryId": "string", "productId": "string", "insDateTime": "string"}- 指定された商品IDが存在しない場合
- 指定された部門IDが存在しない場合
- 指定された仕入先で、既に同じ仕入先商品が登録されている場合
- 部門ID、商品IDのいずれも指定されていない場合
- 部門ID、商品IDの両方を指定された場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
{ "type": "about:blank", "title": "Bad Request", "detail": "[productId] 指定された商品IDは存在しません。", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "[categoryId] 指定された部門IDは存在しません。", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "指定された仕入先商品はすでに存在しています。", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "[categoryId] [productId] 部門ID、商品IDのいずれかは必須です。", "status": 400}{ "type": "about:blank", "title": "Bad Request", "detail": "[categoryId] [productId] 部門ID、商品IDはいずれか1つのみ設定してください。", "status": 400}- 指定されたIDが存在しない場合
Media typeapplication/json
object
type
required
string
title
required
string
detail
string
status
integer
Examples
Example指定されたIDが存在しない場合
{ "type": "about:blank", "title": "NotFound", "detail": "指定されたIDのリソースが見つかりません", "status": 404}