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.
/cards/{id}/demand-availabilityAuthorizationOAuth2 access token · headerrequiredAuthorization 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.
inventory:readidstring<uuid>requiredgradestringrequiredCheck stock and demand before setting pack slots
cardIdstring<uuid>requiredgradestringrequiredstockintegerrequiredyourStockintegerrequiredtotalDemandCountsrequiredShow propertiesHide properties
shippingRequestedintegerrequiredheldintegerrequiredundrawnintegerrequiredreservedintegerrequiredpartnersobject[]requiredShow propertiesHide properties
objectshippingRequestedintegerrequiredheldintegerrequiredundrawnintegerrequiredreservedintegerrequirednamestringrequiredyoursbooleanrequiredgeneratedAtstring<date-time> | nullrequiredhasUnassignedGradeDemandbooleanrequiredurgentShortageintegerrequiredforecastShortageintegerrequiredinvalid_request: a parameter is invalid.
errorstringrequiredThe error code. The main ones are below; more may be added.
400:invalid_request(bad parameters or body),invalid_cursor401:invalid_token403:insufficient_scope,connection_revoked,client_disabled,forbidden,ip_not_allowed404:not_found409:conflict(updated at the same time; read again and retry),idempotency_conflict(arequestIdreused for different content),receipt_not_confirmed(a purchase awaiting the customer's payment confirmation)422units:unit_unavailable(not in stock),unit_not_allocated(not allocated to this partner),unit_not_found422holds:invalid_expiry,hold_shipped,hold_cancelled,hold_confirmed,hold_blocked,sale_amount_required(neither a sale price nor a market value)422listings 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_refused422moves: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_refused422other:invalid_webhook_url,invalid_generated_at429:rate_limited503:photo_unavailable
scopestringWith insufficient_scope, the missing scope
requestIdstring<uuid>inventoryItemIdsstring<uuid>[]holdIdsstring<uuid>[]commitmentIdsstring<uuid>[]invalid_token: the token is missing, expired, or for another resource.
errorstringrequiredThe error code. The main ones are below; more may be added.
400:invalid_request(bad parameters or body),invalid_cursor401:invalid_token403:insufficient_scope,connection_revoked,client_disabled,forbidden,ip_not_allowed404:not_found409:conflict(updated at the same time; read again and retry),idempotency_conflict(arequestIdreused for different content),receipt_not_confirmed(a purchase awaiting the customer's payment confirmation)422units:unit_unavailable(not in stock),unit_not_allocated(not allocated to this partner),unit_not_found422holds:invalid_expiry,hold_shipped,hold_cancelled,hold_confirmed,hold_blocked,sale_amount_required(neither a sale price nor a market value)422listings 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_refused422moves: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_refused422other:invalid_webhook_url,invalid_generated_at429:rate_limited503:photo_unavailable
scopestringWith insufficient_scope, the missing scope
requestIdstring<uuid>inventoryItemIdsstring<uuid>[]holdIdsstring<uuid>[]commitmentIdsstring<uuid>[]One of insufficient_scope, connection_revoked, client_disabled or forbidden.
errorstringrequiredThe error code. The main ones are below; more may be added.
400:invalid_request(bad parameters or body),invalid_cursor401:invalid_token403:insufficient_scope,connection_revoked,client_disabled,forbidden,ip_not_allowed404:not_found409:conflict(updated at the same time; read again and retry),idempotency_conflict(arequestIdreused for different content),receipt_not_confirmed(a purchase awaiting the customer's payment confirmation)422units:unit_unavailable(not in stock),unit_not_allocated(not allocated to this partner),unit_not_found422holds:invalid_expiry,hold_shipped,hold_cancelled,hold_confirmed,hold_blocked,sale_amount_required(neither a sale price nor a market value)422listings 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_refused422moves: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_refused422other:invalid_webhook_url,invalid_generated_at429:rate_limited503:photo_unavailable
scopestringWith insufficient_scope, the missing scope
requestIdstring<uuid>inventoryItemIdsstring<uuid>[]holdIdsstring<uuid>[]commitmentIdsstring<uuid>[]not_found
errorstringrequiredThe error code. The main ones are below; more may be added.
400:invalid_request(bad parameters or body),invalid_cursor401:invalid_token403:insufficient_scope,connection_revoked,client_disabled,forbidden,ip_not_allowed404:not_found409:conflict(updated at the same time; read again and retry),idempotency_conflict(arequestIdreused for different content),receipt_not_confirmed(a purchase awaiting the customer's payment confirmation)422units:unit_unavailable(not in stock),unit_not_allocated(not allocated to this partner),unit_not_found422holds:invalid_expiry,hold_shipped,hold_cancelled,hold_confirmed,hold_blocked,sale_amount_required(neither a sale price nor a market value)422listings 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_refused422moves: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_refused422other:invalid_webhook_url,invalid_generated_at429:rate_limited503:photo_unavailable
scopestringWith insufficient_scope, the missing scope
requestIdstring<uuid>inventoryItemIdsstring<uuid>[]holdIdsstring<uuid>[]commitmentIdsstring<uuid>[]
