Sell from Claude Code
Create a listing, upload a file, attach it as a deliverable, and publish — all from a Python script.
A user says “sell my ebook for $19.” The agent needs to create a listing, upload the file, attach it as a deliverable, and publish — four API calls in sequence.
Full script
What happens
Step 1 — Create listing. content_type="static" tells ListBee to deliver the file automatically after payment. The listing is created in draft status. The readiness object in the response includes a no_deliverable action pointing to the next call.
Step 2 — Upload file. POST /v1/files uploads the file to Bunny CDN and returns a token. The token is a reference — it doesn’t contain the file content.
Step 3 — Attach deliverable. POST /v1/listings/{id}/deliverables links the uploaded file to the listing. Buyers receive a signed download link valid for 48 hours and up to 10 downloads after payment.
Step 4 — Publish. POST /v1/listings/{id}/publish makes the listing live. The product page is immediately accessible. readiness.sellable becomes true.
Reading the readiness object
After step 1, the response looks like:
readiness.next is the action code the agent should resolve first. After attaching a deliverable, next becomes not_published. After publishing, next becomes null and sellable becomes true.
Agents can follow this chain without any hardcoded logic about what comes next.
Variations
URL deliverable instead of file upload — skip steps 2 and 3, use type="url" with a value:
Text deliverable — deliver a license key, access code, or any short text:
AI-generated content — use content_type="generated" instead of static. ListBee holds the order in processing status until the agent calls fulfill_order with the generated content. See Fulfillment for details.