コンテンツにスキップ
トレカクラウド
Esc
↑↓移動↵開く⌘Jプレビュー

在庫の変更を読む

拠点・保管場所・個体の変更を、カーソルの続きから返します。data は読み取り時点の値なので、受け手は id で上書き保存するだけで済みます。カーソルなしで呼ぶと先頭から返り、全件を同期できます。削除はなく、無効化は isActive、個体が在庫から出たことは status で表れます。

hasMore が true の間は、nextCursor を付けて続けて読みます。

GET/inventory/changes
Authorization
AuthorizationOAuth2 access token · headerrequired

認可コードフロー(PKCE S256 必須)。認可・トークン・更新のリクエストには resource=https://api.toreca-cloud.com/partner/v1 を付けます。アクセストークンは15分、リフレッシュトークンは90日有効で、更新のたびに入れ替わります。

Scopes:inventory:read
Query parameters
cursorstring

前回の nextCursor。中身は解釈しないでください。

max length 64
limitinteger
min 1 · max 500 · default: 200
Responses
200

変更

changesChange[]required
Show properties
Array of Change
typestringrequired
Allowed:sitelocationitem
idstring<uuid>required
dataobjectrequired

読み取り時点の拠点・保管場所・個体。個体の項目は管理番号、状態、所在、カード、グレード、状態タグ、写真、取得額などです。

nextCursorstringrequired
hasMorebooleanrequired
400

invalid_request または invalid_cursor

errorstringrequired

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

401

invalid_token。トークンがない、期限切れ、または別のリソース向けです。

errorstringrequired

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

403

insufficient_scope、connection_revoked、client_disabled、forbidden のいずれかです。

errorstringrequired

エラーのコード

scopestring

insufficient_scope のとき、足りない権限

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.toreca-cloud.com/partner/v1/inventory/changes' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Response
{
  "changes": [
    {
      "type": "site",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "data": {}
    }
  ],
  "nextCursor": "string",
  "hasMore": true
}