API reference / Collectors
8 operations.
/api/v1/holdsThe caller’s holds, newest first, with the book and the store.
collector.listMyHolds()holds:read(API keys are coming soon)If-None-MatchX-Request-Idobject
unauthorized: Not signed in (no session or token, or an expired one).
internal: Something went wrong on our side (quote the requestId).
curl 'https://collection.id/api/v1/holds' \
-H "Authorization: Bearer $COLLECTOR_TOKEN"await collector.listMyHolds();/api/v1/holdsAsk the store to set copies of a listing aside. The store accepts or declines within 48 hours; an accepted hold keeps the book aside for the store’s hold days.
collector.requestHold()holds:write(API keys are coming soon)Idempotency-KeyX-Request-Idobject
listingIdstring (uuid)requiredquantityintegeroptional1–50 · default 1messagestring or nulloptionalat most 1000 charactersobject
invalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
idempotency_in_progress: The first request with this key is still running.
listing_unavailable: The book isn’t listed, or not enough copies are left.
store_unavailable: The store isn’t taking requests right now.
store_closed: The store has closed.
holds_unavailable: The store isn’t taking holds right now.
too_many_holds: The caller has too many open holds.
invalid_quantity: Hold between 1 and 50 copies, no more than are listed.
own_store: The book is in the caller’s own store.
idempotency_key_reused: This key was used for a different request.
rate_limited: Too many requests; wait the Retry-After seconds.
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d @body.jsonawait collector.requestHold({ body: { … } });/api/v1/holds/{holdId}/cancelThe buyer cancels, or the store releases a hold. A store releasing an accepted hold records "no sale" and puts the copies back on the shelf.
collector.cancelHold()holds:writestore:holds:write(API keys are coming soon)Idempotency-KeyX-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
not_found: Nothing at that address.
idempotency_in_progress: The first request with this key is still running.
invalid_state: The hold isn’t in a state that allows this (already answered, closed…).
idempotency_key_reused: This key was used for a different request.
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds/<holdId>/cancel' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)"await collector.cancelHold({ path: { holdId } });/api/v1/holds/{holdId}/completeThe store closes an accepted hold as sold at the final price. That records the seller fee and asks the buyer to confirm the purchase.
collector.completeHold()store:holds:write(API keys are coming soon)Idempotency-KeyX-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
finalPriceCentsintegerrequired0–2000000000object
feeobject or nullrequiredfee_centsintegerrequiredfee_bpsintegerrequiredcurrencystringrequiredinvalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
forbidden: The caller’s side can’t do this (only the store answers a request…).
not_found: Nothing at that address.
idempotency_in_progress: The first request with this key is still running.
invalid_state: The hold isn’t in a state that allows this (already answered, closed…).
idempotency_key_reused: This key was used for a different request.
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds/<holdId>/complete' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d @body.jsonawait collector.completeHold({ path: { holdId }, body: { … } });/api/v1/holds/{holdId}/confirmThe buyer answers "Did you buy this?" after the store records the sale.
collector.confirmHoldPurchase()holds:write(API keys are coming soon)X-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
confirmedbooleanrequiredobject
invalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
unauthorized: Not signed in (no session or token, or an expired one).
forbidden: The caller’s side can’t do this (only the store answers a request…).
not_found: Nothing at that address.
invalid_state: The hold isn’t in a state that allows this (already answered, closed…).
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds/<holdId>/confirm' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H 'Content-Type: application/json' \
-d @body.jsonawait collector.confirmHoldPurchase({ path: { holdId }, body: { … } });/api/v1/holds/{holdId}/messagesThe thread between the buyer and the store’s staff, oldest first.
collector.listHoldMessages()holds:readstore:holds:read(API keys are coming soon)If-None-MatchX-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
unauthorized: Not signed in (no session or token, or an expired one).
not_found: Nothing at that address.
internal: Something went wrong on our side (quote the requestId).
curl 'https://collection.id/api/v1/holds/<holdId>/messages' \
-H "Authorization: Bearer $COLLECTOR_TOKEN"await collector.listHoldMessages({ path: { holdId } });/api/v1/holds/{holdId}/messagesThe other side gets one notification per unread thread.
collector.postHoldMessage()holds:writestore:holds:write(API keys are coming soon)Idempotency-KeyX-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
bodystringrequired1–2000 charactersobject
invalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
not_found: Nothing at that address.
idempotency_in_progress: The first request with this key is still running.
idempotency_key_reused: This key was used for a different request.
rate_limited: Too many requests; wait the Retry-After seconds.
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds/<holdId>/messages' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d @body.jsonawait collector.postHoldMessage({ path: { holdId }, body: { … } });/api/v1/holds/{holdId}/respondThe store sets the book aside (accept), or declines with an optional reason.
collector.respondToHold()store:holds:write(API keys are coming soon)Idempotency-KeyX-Request-Id| Name | In | Type | About |
|---|---|---|---|
holdIdrequired | path | string (uuid) |
object
acceptbooleanrequiredreasonstring or nulloptionalat most 500 charactersobject
invalid_request: The query or body doesn’t match the schema (see errors[]).
invalid_json: The body isn’t JSON.
invalid_idempotency_key: The Idempotency-Key isn’t 1–255 visible ASCII characters.
unauthorized: Not signed in (no session or token, or an expired one).
forbidden: The caller’s side can’t do this (only the store answers a request…).
not_found: Nothing at that address.
idempotency_in_progress: The first request with this key is still running.
invalid_state: The hold isn’t in a state that allows this (already answered, closed…).
listing_unavailable: The book isn’t listed, or not enough copies are left.
store_unavailable: The store isn’t taking requests right now.
store_closed: The store has closed.
idempotency_key_reused: This key was used for a different request.
internal: Something went wrong on our side (quote the requestId).
curl -X POST 'https://collection.id/api/v1/holds/<holdId>/respond' \
-H "Authorization: Bearer $COLLECTOR_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'Content-Type: application/json' \
-d @body.jsonawait collector.respondToHold({ path: { holdId }, body: { … } });