A database is one pool of stock for one product, the same thing you create under Inventory in the panel. Every connected listing draws from it, and every code you upload belongs to one. The Database endpoints let your software create databases, read their stock counts, rename them, and remove empty ones, all from one bearer token.
Make sure you have:
POST /login (see Get started with the Keysender API).https://panel.keysender.com/api/v1.0 and the header Authorization: Bearer YOUR_ACCESS_TOKEN on every call.A database has these fields in every response: id, name, type (0 for text codes, 1 for files), available (codes in stock), to_send (codes reserved for orders that are still delivering), and sku.
GET /databases. Add page, pagesize, or filter=[{"name":"part of a name"}] to narrow the list.curl "https://panel.keysender.com/api/v1.0/databases?pagesize=50" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
GET /database?id=123. You receive the six fields above, or 422 if the id is not yours.POST /database with name, sku, and type:curl -X POST "https://panel.keysender.com/api/v1.0/database" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Steam key: Example Game", "sku": "EXAMPLE-GAME-STEAM", "type": 0}'
sku is the identifier your own systems use. If a database with that SKU already exists on your account, the API returns the existing database instead of creating a second one, so a repeated create is safe.PUT /database with id and the new name. The sku and type cannot be changed after creation; create a new database instead.DELETE /database with {"id": 123} in the body.to_send above 0) cannot be deleted. Wait for those orders to finish, then retry.After POST /database, GET /databases lists the new entry with available: 0, and it appears under Inventory in the panel with the same name. After a delete, it is gone from both.
422 with You can change only own code databases: the id belongs to another account or does not exist.to_send on the database first.The API returns the existing database instead of creating a second one. That makes create safe to run on every sync: the SKU is the match key.
No. PUT /database only changes the name. Create a new database for a different SKU or type and move the stock.
A database with codes reserved for orders still delivering (to_send above 0) cannot be deleted. Wait for those deliveries to finish, then retry.