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

Check stock and demand before setting pack slots

Reads the latest reports of the configured pair at this shop for the exact grade. stock counts units either partner can hold, once each; yourStock counts units the caller can hold. In partners, yours marks the caller and a null generatedAt means no report yet. Urgent shortage is max(0, shippingRequested − stock); forecast shortage is max(0, shippingRequested + held + undrawn − stock). Already reserved slots do not add to either shortage. For new slots, add their number to undrawn when calculating the forecast. Any-card lines are excluded. hasUnassignedGradeDemand indicates additional outstanding demand naming this card whose grade is unspecified, unmatched or ambiguous; it is excluded from the counts.

GET/cards/{id}/demand-availability
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
Path parameters
idstring<uuid>required
Query parameters
gradestringrequired
matches ^([a-z0-9_-]{1,32}):([A-Za-z0-9.+_-]{1,32})$
Responses
200

Check stock and demand before setting pack slots

cardIdstring<uuid>required
gradestringrequired
stockintegerrequired
min 0
yourStockintegerrequired
min 0
totalDemandCountsrequired
Show properties
shippingRequestedintegerrequired
min 0
heldintegerrequired
min 0
undrawnintegerrequired
min 0
reservedintegerrequired
min 0
partnersobject[]required
Show properties
Array of object
shippingRequestedintegerrequired
min 0
heldintegerrequired
min 0
undrawnintegerrequired
min 0
reservedintegerrequired
min 0
namestringrequired
yoursbooleanrequired
generatedAtstring<date-time> | nullrequired
hasUnassignedGradeDemandbooleanrequired
urgentShortageintegerrequired
min 0
forecastShortageintegerrequired
min 0
400

invalid_request: a parameter is invalid.

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>[]
404

not_found

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/cards/497f6eca-6276-4993-bfeb-53cbbbba6f08/demand-availability?grade=psa%3A10' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "cardId": "f16ba382-eb42-481a-b08f-c57bdc9aae24",
  "grade": "string",
  "stock": 0,
  "yourStock": 0,
  "total": {
    "shippingRequested": 0,
    "held": 0,
    "undrawn": 0,
    "reserved": 0
  },
  "partners": [
    {
      "shippingRequested": 0,
      "held": 0,
      "undrawn": 0,
      "reserved": 0,
      "name": "string",
      "yours": true,
      "generatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "hasUnassignedGradeDemand": true,
  "urgentShortage": 0,
  "forecastShortage": 0
}

Was this page helpful?