Migration
Welcome to the Winston POS v2.0 API migration guide!
We're excited to announce version two of our API. This version update aims to be more predictable, robust, and developer-friendly. It includes stricter RESTful conventions, simplified payload structures, and it now relies on standard HTTP status codes for proper error handling.
This guide outlines all the breaking changes, endpoint relocations, and payload modifications you will need to update your integrations.
At a glance, the biggest changes include:
- Bearer token authentication: API keys have moved from query parameters to the
Authorizationheader. - Strict HTTP status codes: We have removed the redundant
status: 'success'wrapper from almost all JSON responses. Success and failure are now strictly indicated by standard HTTP status codes (e.g., 200 OK, 400 Bad Request). - Unified collection routes: All collection-based endpoints have been centralized under the
/list/path. - Cleaner payloads: We've flattened unnecessary
dataobjects and renamed fields to be more intuitive and consistent across the board.
We know migrations can be a chore, but we highly recommend updating your integrations as soon as possible to take advantage of the improved reliability.
Missing anything, or running into unexpected issues? Feel free to contact our API support team.
Authentication
Authentication is no longer handled via query parameters.
The new API requires that the API key is provided through the Authorization HTTP header as a Bearer token (Authorization: Bearer <api_key>).
This is the same API key as you would previously provide in the api_key query parameter (exception noted below).
The app_name query parameter is no longer required.
Miscellaneous integrations
The new API no longer supports API keys that had a corresponding app_name value of 'selforder'.
The corresponding integration has also been marked as legacy in our backoffice.
The new API works with the new miscellaneous integration that requires you to sign up as an integrator before you can authenticate to our API. You can read here how that works.
If you are currently not using the 'selforder' app name, you don't have to do anything.
The other integrations will still work with your existing API key.
Routes
Below is the categorized list of route changes.
General / Collections
- Endpoint relocation: All collection routes are now nested under the
/list/route. In the V1 API, these were custom routes at the root (e.g.,/billsis now/list/bills). - Response changes: The
/list/route no longer returns thestatusfield.
Schemas
/schemas/- The
datakey in the response payload has been renamed tocollections. - The
statusfield has been removed.
- The
/schemas/:collection/- The
datakey in the response payload has been renamed toschema. - The
statusfield has been removed. - Error handling: Now correctly returns a non-200 HTTP status code on error instead of a 200 OK with a failed status payload.
- The
Tenants
/tenants/- The endpoint to create a tenant has been moved to
/tenants/create. - The
statusfield in the response has been removed.
- The endpoint to create a tenant has been moved to
Categories
/categories/vatList/- The
statusfield in the response has been removed.
- The
List
/list/- The
statusfield has been removed. - The
datafield has been renamed tocollections.
- The
/list/:collectionName/- The
statusfield has been removed.
- The
Sync
- Endpoint relocation: The
/:collectionName/syncroutes have been moved to/sync/:collectionName. /sync/- The
statusfield has been removed. - The
datafield has been renamed tocollections.
- The
/sync/:collectionName/- The
statusfield has been removed.
- The
Reservations
- Removed endpoints:
/reservations/get(Use the/reservations/listroute instead)./reservations/remove(Use the/reservations/deleteroute instead)./reservations/list(Use the/list/reservationsroute instead).
- Error handling & response changes: The following routes no longer return
trueorfalsebooleans. Instead, if no entries are updated/removed, they will return a 400 HTTP error code:/reservations/update/reservations/delete/reservations/assignTable/reservations/removeTable/reservations/checkIn
Tables
/tables/order- The
statusfield has been removed. - The
datafield has been removed; theorderobject is now part of the root response object.
- The
/tables/order/verify- Endpoint relocation: Moved to
/tables/verifyOrder. - The
statusfield has been removed. - The
datafield has been renamed toorder.
- Endpoint relocation: Moved to
/tables/pay- Request body: The
_idfield has been renamed toid. - The
statusfield in the response has been removed.
- Request body: The