Skip to content
トレカクラウド
Esc
↑↓navigate↵open⌘Jpreview

Read inventory changes

Returns changes to sites, storage locations and units after the cursor. data is the current value at read time, so the receiver only upserts by id. Without a cursor it starts from the beginning, which syncs everything. Nothing is deleted: deactivation shows in isActive, and a unit leaving stock shows in status.

Keep reading with nextCursor while hasMore is true.

GET/inventory/changes
Authorization
AuthorizationOAuth2 access token · headerrequired

Authorization code flow (PKCE S256 required). Send resource=https://api.toreca-cloud.com/partner/v1 with the authorization, token and refresh requests. Access tokens last 15 minutes; refresh tokens last 90 days and rotate on every refresh.

Scopes:inventory:read
Query parameters
cursorstring

The previous nextCursor. Treat it as opaque.

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

Extras to receive, comma separated. sealed: also return BOX, pack and pre-built deck units (without it, only card units). snkrdunk: put the SNKRDUNK product on a unit's card.snkrdunk / product.snkrdunk. It is costly, so keep limit at 200 or below with it. The cursor points to the same place whatever include says. When you start sending it partway, or want new fields on units you already synced, read once from the beginning without a cursor.

max length 64 · matches ^(sealed|snkrdunk)(,(sealed|snkrdunk))*$
Responses
200

The changes

changesChange[]required
Show properties
Array of Change
typestringrequired
Allowed:sitelocationitem
idstring<uuid>required
dataSite | Location | InventoryItemrequired

The site, storage location or unit as of read time: Site for site, Location for location, InventoryItem for item.

Show properties
Any of:
Site
idstring<uuid>
codestring
namestring
kindstring
countryCodestring
timezonestring
addressobject | null

The site's address; only the parts the shop entered.

Show properties
postalCodestring
regionstring
localitystring
line1string
line2string
isActiveboolean
createdAtstring<date-time>
updatedAtstring<date-time>
locationsLocation[]
Show properties
Array of 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>required
createdAtstring<date-time>required
updatedAtstring<date-time>required
assetNumberstringrequired
sourceKindstringrequired
Allowed:purchasereceipttenant_transfer
productKindstringrequired

What the unit is. box, pack and deck are returned only with include=sealed.

Allowed:cardboxpackdeck
statusstringrequired
versionintegerrequired
siteIdstring<uuid> | nullrequired
Show properties
One of:
string<uuid>
string<uuid>
null
null
locationIdstring<uuid> | nullrequired
Show properties
One of:
string<uuid>
string<uuid>
null
null
gradeUnitGrade | nullrequired
Show properties
One of:
UnitGrade
serviceCodestringrequired
serviceNamestringrequired
serviceKindstringrequired
Allowed:third_partyinternal
codestringrequired
labelstringrequired
numericScorenumber | nullrequired
Show properties
One of:
number
number
null
null
null
null
certificationNumberstring | nullrequired
Show properties
One of:
string
string
null
null
certificationVerifiedbooleanrequired
conditionNotestring | nullrequired
Show properties
One of:
string
string
null
null
acquisitionAmountMinorinteger | nullrequired
Show properties
One of:
integer
integer
null
null
acquisitionCostBasisstringrequired

How the acquisition amount is known: actual (a Toreca Cloud purchase, or an external purchase matched to the unit), estimated (estimated from external purchases), recorded (entered on receipt or correction, or carried over from a transfer), unset.

Allowed:actualestimatedrecordedunset
purchaseobject | nullrequired

The purchase from the seller. null for units received without a linked external purchase and units accepted by transfer. Seller details and purchase amounts are not returned.

Show properties
One of:
object
purchasedAtstring<date-time>required

The purchase date: arrival time for an external purchase, completion time for a Toreca Cloud purchase (same as acquiredAt).

sourcestringrequired

toreca_cloud for a Toreca Cloud purchase, external for one in the shop's other purchasing system.

Allowed:toreca_cloudexternal
matchstringrequired

confirmed when matched to the unit's certification number, estimated when inferred on import. Always confirmed for Toreca Cloud purchases.

Allowed:confirmedestimated
certificationNumberstring | nullrequired

The certification number on the external purchase line; while estimated, only a candidate. null for Toreca Cloud purchases (see the unit's certificationNumber).

null
null
currencystringrequired
acquiredAtstring<date-time>required

When the unit entered the shop's stock. For the purchase date, see purchase.purchasedAt.

lastMovedAtstring<date-time>required
allocationstringrequired
Allowed:yoursothersnone
holdablebooleanrequired
holdRefusalstring | nullrequired

Why holdable is false: the error code a hold would be refused with now. unit_unavailable means the unit is not in stock (held, listed, on one of the shop's outbound orders, sold and so on), unit_not_allocated that it is set aside for another partner or kept by the shop for another use (or, on an allocated connection, not for this one), and receipt_not_confirmed that it was bought from a customer who has not yet confirmed receiving the payout. When several apply, the first in this order is given. null when holdable is true. More values may be added later.

Allowed:unit_unavailableunit_not_allocatedreceipt_not_confirmednull
commitmentobject | nullrequired
Show properties
One of:
object
idstring<uuid>required
purposestringrequired
Allowed:oripasale
labelstringrequired
externalRefstring | nullrequired
Show properties
One of:
string
string
null
null
null
null
marketValueMarketValue | nullrequired
Show properties
One of:
MarketValue
amountMinorintegerrequired
currencystringrequired
pricedAtstring<date-time>required
null
null
conditionTagsobject[]required
Show properties
Array of object
idstring<uuid>required
namestringrequired
photosobjectrequired
Show properties
frontobject | nullrequired
Show properties
One of:
object
urlstring<uri>required
updatedAtstring<date-time>required
null
null
backobject | nullrequired
Show properties
One of:
object
urlstring<uri>required
updatedAtstring<date-time>required
null
null
cardobject | nullrequired

The card of a card unit; null for BOX, pack and deck units.

Show properties
idstring<uuid>required
namestringrequired
localizedNamesobjectrequired
cardNumberstring | nullrequired
Show properties
One of:
string
string
null
null
languageCodestringrequired
variantstring | nullrequired
Show properties
One of:
string
string
null
null
finishstring | nullrequired
Show properties
One of:
string
string
null
null
imageUrlstring | nullrequired
Show properties
One of:
string
string
null
null
rarityobject | nullrequired
Show properties
One of:
object
codestringrequired
namestringrequired
null
null
setobject | nullrequired
Show properties
One of:
object
idstring<uuid>required
codestringrequired
namestringrequired
nameEnstring | nullrequired
Show properties
One of:
string
string
null
null
null
null
gameGamerequired
Show properties
idstring<uuid>
codestring
namestring
snkrdunkSnkrdunkProduct | null

Present only with include=snkrdunk. null means there is no link.

Show properties
One of:
SnkrdunkProduct
productIdstringrequired
matches ^[1-9][0-9]*$
urlstring<uri>required
null
null
productobject | nullrequired

The product of a BOX, pack or deck unit; null for card units.

Show properties
One of:
object
idstring<uuid>required
kindstringrequired
Allowed:boxpackdeck
namestringrequired
productCodestring | nullrequired
janCodestring | nullrequired
languageCodestringrequired
imageUrlstring | nullrequired
gameGamerequired
Show properties
idstring<uuid>
codestring
namestring
snkrdunkSnkrdunkProduct | null

Present only with include=snkrdunk. null means there is no link.

Show properties
One of:
SnkrdunkProduct
productIdstringrequired
matches ^[1-9][0-9]*$
urlstring<uri>required
null
null
null
null
shrinkStatusstring | nullrequired

Whether a BOX, pack or deck still has its shrink wrap; null for card units.

Allowed:presentabsentunknownnull
nextCursorstringrequired
hasMorebooleanrequired
400

invalid_request or invalid_cursor

errorstringrequired

The error code. The main ones are below; more may be added.

  • 400: invalid_request (bad parameters or body), invalid_cursor
  • 401: invalid_token
  • 403: insufficient_scope, connection_revoked, client_disabled, forbidden, ip_not_allowed
  • 404: not_found
  • 409: conflict (updated at the same time; read again and retry), idempotency_conflict (a requestId reused for different content), receipt_not_confirmed (a purchase awaiting the customer's payment confirmation)
  • 422 units: unit_unavailable (not in stock), unit_not_allocated (not allocated to this partner), unit_not_found
  • 422 holds: invalid_expiry, hold_shipped, hold_cancelled, hold_confirmed, hold_blocked, sale_amount_required (neither a sale price nor a market value)
  • 422 listings and shipments: 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 moves: 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 other: invalid_webhook_url, invalid_generated_at
  • 429: rate_limited
  • 503: photo_unavailable
scopestring

With insufficient_scope, the missing scope

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

invalid_token: the token is missing, expired, or for another resource.

errorstringrequired

The error code. The main ones are below; more may be added.

  • 400: invalid_request (bad parameters or body), invalid_cursor
  • 401: invalid_token
  • 403: insufficient_scope, connection_revoked, client_disabled, forbidden, ip_not_allowed
  • 404: not_found
  • 409: conflict (updated at the same time; read again and retry), idempotency_conflict (a requestId reused for different content), receipt_not_confirmed (a purchase awaiting the customer's payment confirmation)
  • 422 units: unit_unavailable (not in stock), unit_not_allocated (not allocated to this partner), unit_not_found
  • 422 holds: invalid_expiry, hold_shipped, hold_cancelled, hold_confirmed, hold_blocked, sale_amount_required (neither a sale price nor a market value)
  • 422 listings and shipments: 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 moves: 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 other: invalid_webhook_url, invalid_generated_at
  • 429: rate_limited
  • 503: photo_unavailable
scopestring

With insufficient_scope, the missing scope

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

One of insufficient_scope, connection_revoked, client_disabled or forbidden.

errorstringrequired

The error code. The main ones are below; more may be added.

  • 400: invalid_request (bad parameters or body), invalid_cursor
  • 401: invalid_token
  • 403: insufficient_scope, connection_revoked, client_disabled, forbidden, ip_not_allowed
  • 404: not_found
  • 409: conflict (updated at the same time; read again and retry), idempotency_conflict (a requestId reused for different content), receipt_not_confirmed (a purchase awaiting the customer's payment confirmation)
  • 422 units: unit_unavailable (not in stock), unit_not_allocated (not allocated to this partner), unit_not_found
  • 422 holds: invalid_expiry, hold_shipped, hold_cancelled, hold_confirmed, hold_blocked, sale_amount_required (neither a sale price nor a market value)
  • 422 listings and shipments: 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 moves: 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 other: invalid_webhook_url, invalid_generated_at
  • 429: rate_limited
  • 503: photo_unavailable
scopestring

With insufficient_scope, the missing scope

requestIdstring<uuid>
inventoryItemIdsstring<uuid>[]
holdIdsstring<uuid>[]
commitmentIdsstring<uuid>[]
Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.toreca-cloud.com/partner/v1/inventory/changes' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "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
}

Was this page helpful?