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

在庫の変更を読む

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

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

GET/inventory/changes
認証
AuthorizationOAuth2 アクセストークン · header必須

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

スコープ:inventory:read
クエリパラメーター
cursorstring

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

最大長 64
limitinteger
最小 1 · 最大 500 · デフォルト: 200
includestring

追加で受け取るものをカンマ区切りで指定します。sealed:BOX・パック・構築済みデッキの個体も返します(指定しなければカードの個体だけ)。snkrdunk:個体の card.snkrdunk / product.snkrdunk にスニダンの商品を載せます。処理が重いので、指定するときは limit を200以下にしてください。cursorは include によらず同じ位置を指します。途中から指定し始めたときや、同期済みの個体に新しい項目を反映したいときは、一度cursorなしで先頭から読み直してください。

最大長 64 · ^(sealed|snkrdunk)(,(sealed|snkrdunk))*$ に一致
レスポンス
200

変更

changesChange[]必須
プロパティを表示
Change の配列
typestring必須
許可される値:sitelocationitem
idstring<uuid>必須
dataSite | Location | InventoryItem必須

読み取り時点の拠点・保管場所・個体。type が site なら Site、location なら Location、item なら InventoryItem です。

プロパティを表示
いずれか:
Site
idstring<uuid>
codestring
namestring
kindstring
countryCodestring
timezonestring
addressobject | null

拠点の住所。登録した項目だけが入ります。

プロパティを表示
postalCodestring
regionstring
localitystring
line1string
line2string
isActiveboolean
createdAtstring<date-time>
updatedAtstring<date-time>
locationsLocation[]
プロパティを表示
Location の配列
idstring<uuid>
siteIdstring<uuid>
codestring
namestring
kindstring
isActiveboolean
createdAtstring<date-time>
updatedAtstring<date-time>
Location
idstring<uuid>
siteIdstring<uuid>
codestring
namestring
kindstring
isActiveboolean
createdAtstring<date-time>
updatedAtstring<date-time>
InventoryItem
idstring<uuid>必須
createdAtstring<date-time>必須
updatedAtstring<date-time>必須
assetNumberstring必須
sourceKindstring必須
許可される値:purchasereceipttenant_transfer
productKindstring必須

個体の種類。box・pack・deck は include=sealed のときだけ返ります。

許可される値:cardboxpackdeck
statusstring必須
versioninteger必須
siteIdstring<uuid> | null必須
プロパティを表示
いずれか 1 つ:
string<uuid>
string<uuid>
null
null
locationIdstring<uuid> | null必須
プロパティを表示
いずれか 1 つ:
string<uuid>
string<uuid>
null
null
gradeUnitGrade | null必須
プロパティを表示
いずれか 1 つ:
UnitGrade
serviceCodestring必須
serviceNamestring必須
serviceKindstring必須
許可される値:third_partyinternal
codestring必須
labelstring必須
numericScorenumber | null必須
プロパティを表示
いずれか 1 つ:
number
number
null
null
null
null
certificationNumberstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
certificationVerifiedboolean必須
conditionNotestring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
acquisitionAmountMinorinteger | null必須
プロパティを表示
いずれか 1 つ:
integer
integer
null
null
acquisitionCostBasisstring必須

仕入額の区分。actual はトレカクラウドの買取額か実物と照合した外部の買取額、estimated は外部の買取から推定した額、recorded は入庫や訂正で入力した額や移管元から引き継いだ額、unset は未設定。

許可される値:actualestimatedrecordedunset
purchaseobject | null必須

個体を売り手から買い取った記録。外部の買取にも紐付いていない入庫の個体や、移管で受け入れた個体は null。売り手の情報や買取の金額は返しません。

プロパティを表示
いずれか 1 つ:
object
purchasedAtstring<date-time>必須

買取日。外部の買取なら到着日時、トレカクラウドの買取なら成立日時(acquiredAt と同じ)。

sourcestring必須

toreca_cloud はトレカクラウドでの買取、external は店舗の別の買取システムでの買取。

許可される値:toreca_cloudexternal
matchstring必須

confirmed は実物の認定番号と照合して確定済み、estimated は取込時の推定。トレカクラウドの買取は常に confirmed。

許可される値:confirmedestimated
certificationNumberstring | null必須

外部の買取明細の認定番号。estimated の間は候補で、実物の番号とは限りません。トレカクラウドの買取は null(個体の certificationNumber を見てください)。

null
null
currencystring必須
acquiredAtstring<date-time>必須

個体が店舗の在庫に入った日時。買取日は purchase.purchasedAt を見てください。

lastMovedAtstring<date-time>必須
allocationstring必須
許可される値:yoursothersnone
holdableboolean必須
holdRefusalstring | null必須

holdable が false の理由。いま確保すると返るエラーコードと同じ値です。unit_unavailable は在庫にない(確保中・出品中・店舗の出庫予約に入っている・売却済みなど)、unit_not_allocated はほかの連携先に割り当て済みか、店舗が別の用途に確保している(allocated の接続では自分に割り当てられていない)、receipt_not_confirmed はお客様の着金確認待ちの買取品です。理由が重なるときは、この順で最初の1つを返します。holdable が true のときは null。今後、値が増えることがあります。

許可される値:unit_unavailableunit_not_allocatedreceipt_not_confirmednull
commitmentobject | null必須
プロパティを表示
いずれか 1 つ:
object
idstring<uuid>必須
purposestring必須
許可される値:oripasale
labelstring必須
externalRefstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
null
null
marketValueMarketValue | null必須
プロパティを表示
いずれか 1 つ:
MarketValue
amountMinorinteger必須
currencystring必須
pricedAtstring<date-time>必須
null
null
conditionTagsobject[]必須
プロパティを表示
object の配列
idstring<uuid>必須
namestring必須
photosobject必須
プロパティを表示
frontobject | null必須
プロパティを表示
いずれか 1 つ:
object
urlstring<uri>必須
updatedAtstring<date-time>必須
null
null
backobject | null必須
プロパティを表示
いずれか 1 つ:
object
urlstring<uri>必須
updatedAtstring<date-time>必須
null
null
cardobject | null必須

カードの個体のカード。BOX・パック・デッキの個体は null。

プロパティを表示
idstring<uuid>必須
namestring必須
localizedNamesobject必須
cardNumberstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
languageCodestring必須
variantstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
finishstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
imageUrlstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
rarityobject | null必須
プロパティを表示
いずれか 1 つ:
object
codestring必須
namestring必須
null
null
setobject | null必須
プロパティを表示
いずれか 1 つ:
object
idstring<uuid>必須
codestring必須
namestring必須
nameEnstring | null必須
プロパティを表示
いずれか 1 つ:
string
string
null
null
null
null
gameGame必須
プロパティを表示
idstring<uuid>
codestring
namestring
snkrdunkSnkrdunkProduct | null

include=snkrdunk のときだけキーごと載ります。null はリンクがないという意味です。

プロパティを表示
いずれか 1 つ:
SnkrdunkProduct
productIdstring必須
^[1-9][0-9]*$ に一致
urlstring<uri>必須
null
null
productobject | null必須

BOX・パック・デッキの個体の商品。カードの個体は null。

プロパティを表示
いずれか 1 つ:
object
idstring<uuid>必須
kindstring必須
許可される値:boxpackdeck
namestring必須
productCodestring | null必須
janCodestring | null必須
languageCodestring必須
imageUrlstring | null必須
gameGame必須
プロパティを表示
idstring<uuid>
codestring
namestring
snkrdunkSnkrdunkProduct | null

include=snkrdunk のときだけキーごと載ります。null はリンクがないという意味です。

プロパティを表示
いずれか 1 つ:
SnkrdunkProduct
productIdstring必須
^[1-9][0-9]*$ に一致
urlstring<uri>必須
null
null
null
null
shrinkStatusstring | null必須

BOX・パック・デッキのシュリンクの有無。カードの個体は null。

許可される値:presentabsentunknownnull
nextCursorstring必須
hasMoreboolean必須
400

invalid_request または invalid_cursor

errorstring必須

エラーのコード。主なものは次のとおりです。今後、値が増えることがあります。

  • 400:invalid_request(パラメーターや本文が正しくない)、invalid_cursor
  • 401:invalid_token
  • 403:insufficient_scope、connection_revoked、client_disabled、forbidden、ip_not_allowed
  • 404:not_found
  • 409:conflict(同時に更新された。読み直してやり直す)、idempotency_conflict(requestId を別の内容に流用した)、receipt_not_confirmed(お客様の着金確認待ちの買取品)
  • 422 個体:unit_unavailable(在庫にない)、unit_not_allocated(この連携先に割り当てられていない)、unit_not_found
  • 422 確保:invalid_expiry、hold_shipped、hold_cancelled、hold_confirmed、hold_blocked、sale_amount_required(売値も時価もない)
  • 422 掲載・配送:commitment_not_on_sale、commitment_not_allocated、commitment_shipping、commitment_blocked、commitment_closed、commitment_not_on_shipment、shipment_shipped、shipment_cancelled、shipment_not_shipped、shipment_blocked、shipment_refused
  • 422 移動:invalid_location、location_inactive、different_site、same_site、mixed_sites、invalid_site、site_inactive、wrong_site、unit_not_on_transfer、transfer_line_closed、unit_not_on_checkout、move_refused、transfer_refused、checkout_refused、return_refused
  • 422 そのほか:invalid_webhook_url、invalid_generated_at
  • 429:rate_limited
  • 503:photo_unavailable
scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
401

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

errorstring必須

エラーのコード。主なものは次のとおりです。今後、値が増えることがあります。

  • 400:invalid_request(パラメーターや本文が正しくない)、invalid_cursor
  • 401:invalid_token
  • 403:insufficient_scope、connection_revoked、client_disabled、forbidden、ip_not_allowed
  • 404:not_found
  • 409:conflict(同時に更新された。読み直してやり直す)、idempotency_conflict(requestId を別の内容に流用した)、receipt_not_confirmed(お客様の着金確認待ちの買取品)
  • 422 個体:unit_unavailable(在庫にない)、unit_not_allocated(この連携先に割り当てられていない)、unit_not_found
  • 422 確保:invalid_expiry、hold_shipped、hold_cancelled、hold_confirmed、hold_blocked、sale_amount_required(売値も時価もない)
  • 422 掲載・配送:commitment_not_on_sale、commitment_not_allocated、commitment_shipping、commitment_blocked、commitment_closed、commitment_not_on_shipment、shipment_shipped、shipment_cancelled、shipment_not_shipped、shipment_blocked、shipment_refused
  • 422 移動:invalid_location、location_inactive、different_site、same_site、mixed_sites、invalid_site、site_inactive、wrong_site、unit_not_on_transfer、transfer_line_closed、unit_not_on_checkout、move_refused、transfer_refused、checkout_refused、return_refused
  • 422 そのほか:invalid_webhook_url、invalid_generated_at
  • 429:rate_limited
  • 503:photo_unavailable
scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
403

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

errorstring必須

エラーのコード。主なものは次のとおりです。今後、値が増えることがあります。

  • 400:invalid_request(パラメーターや本文が正しくない)、invalid_cursor
  • 401:invalid_token
  • 403:insufficient_scope、connection_revoked、client_disabled、forbidden、ip_not_allowed
  • 404:not_found
  • 409:conflict(同時に更新された。読み直してやり直す)、idempotency_conflict(requestId を別の内容に流用した)、receipt_not_confirmed(お客様の着金確認待ちの買取品)
  • 422 個体:unit_unavailable(在庫にない)、unit_not_allocated(この連携先に割り当てられていない)、unit_not_found
  • 422 確保:invalid_expiry、hold_shipped、hold_cancelled、hold_confirmed、hold_blocked、sale_amount_required(売値も時価もない)
  • 422 掲載・配送:commitment_not_on_sale、commitment_not_allocated、commitment_shipping、commitment_blocked、commitment_closed、commitment_not_on_shipment、shipment_shipped、shipment_cancelled、shipment_not_shipped、shipment_blocked、shipment_refused
  • 422 移動:invalid_location、location_inactive、different_site、same_site、mixed_sites、invalid_site、site_inactive、wrong_site、unit_not_on_transfer、transfer_line_closed、unit_not_on_checkout、move_refused、transfer_refused、checkout_refused、return_refused
  • 422 そのほか:invalid_webhook_url、invalid_generated_at
  • 429:rate_limited
  • 503:photo_unavailable
scopestring

insufficient_scope のとき、足りない権限

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
試してみる
サーバー
認証
パラメーター
リクエスト
curl -X GET 'https://api.toreca-cloud.com/partner/v1/inventory/changes' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json'
レスポンス
{
  "changes": [
    {
      "type": "site",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "data": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "code": "string",
        "name": "string",
        "kind": "string",
        "countryCode": "string",
        "timezone": "string",
        "address": {
          "postalCode": "string",
          "region": "string",
          "locality": "string",
          "line1": "string",
          "line2": "string"
        },
        "isActive": true,
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z",
        "locations": [
          {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
            "code": "string",
            "name": "string",
            "kind": "string",
            "isActive": true,
            "createdAt": "2019-08-24T14:15:22Z",
            "updatedAt": "2019-08-24T14:15:22Z"
          }
        ]
      }
    }
  ],
  "nextCursor": "string",
  "hasMore": true
}

このページは役に立ちましたか?