Developer API

Developer API

Integrate directly with simple JSON endpoints. Authentication uses your session (Supabase cookie via our auth middleware).

Auth: Sign in on the site, call endpoints from the same browser session. For server-to-server, contact us for a token flow.

List inventory

GET /api/inventory

Response

{
  "items": [
    {
      "id": "uuid",
      "sku": "SKU-1001",
      "title": "Retro Trainers",
      "price": 49.99,
      "quantity": 12,
      "status": "pending",
      "image_url": "https://…/photo.jpg",
      "selected_for_offer": true,
      "locked_for_offer": false,
      "updated_at": "2025-08-25T18:25:43.511Z"
    }
  ]
}

Create a single item

POST /api/inventory Content-Type: application/json{
   "sku": "SKU-2001",
   "title": "Nylon Weekender",
   "price": 59.00,
   "quantity": 8,
   "condition": "New",
   "image_url": "https://…/bag.jpg"
}

Response 201

{ "item": { "id": "uuid", "sku": "SKU-2001", "status": "pending", "...": "..." } }

Bulk import

POST /api/inventory/bulk Content-Type: application/json[
   { "sku": "SKU-1001", "title": "Retro Trainers", "price": 49.99, "quantity": 12 },
   { "sku": "SKU-1002", "title": "Canvas Tote", "price": 18.5, "quantity": 50 }
]

Response

{ "inserted": 2 }

Submit selected items for an offer

POST /api/offers/requests

Response

{ "ok": true, "offer_request": { "id": "uuid", "status": "submitted", "total_items": 64 } }

Brand verification (optional)

POST /api/verify Content-Type: application/json{ "company_name": "ACME, Inc.", "website": "https://acme.com", "contact_email": "ops@acme.com", "notes": "B2B only" }

Statuses: pendingreviewofferedaccepted/rejected

Errors

  • 401 unauthorized – not signed in
  • 400 no_selected_items – tried to create an offer with nothing selected
  • 422 validation_error – malformed payload