Errors & pagination
Response envelopes, error codes, and how list endpoints paginate.
Response envelope
Every successful response wraps the result in a consistent envelope:
json
{ "data": { /* resource */ }, "error": null}Errors
Errors return a non-2xx status with an error object. details is present for validation errors.
json
{ "data": null, "error": { "message": "A price greater than 0 is required for fixed-price products", "code": "validation_error", "details": [ /* field issues */ ] }}400bad_requestoptional | Malformed or invalid request. |
401unauthorizedoptional | Missing or invalid API key. |
404not_foundoptional | Resource does not exist or isn't yours. |
409conflictoptional | Conflicting state (e.g. deleting a product with payments). |
422validation_erroroptional | Body failed schema validation; see details. |
500internaloptional | Unexpected server error. |
Pagination
List endpoints accept page (default 1) and pageSize (default 20, max 100), and return a meta object alongside data.
json
{ "data": [ /* items */ ], "meta": { "page": 1, "pageSize": 20, "total": 42, "totalPages": 3 }, "error": null}bash
curl "https://your-app.com/api/v1/payments?page=2&pageSize=50" \ -H "Authorization: Bearer $STELLARHOOKS_API_KEY"