WineSitting API Documentation
website·Indexed 32 days ago
https://app.winesitting.com/api/documentationAPI reference for managing wine cellar logistics, including account information, address management, bottle retrieval, order creation, delivery cost calculation, and warehouse and putaway tracking.
What's inside WineSitting
- The Putaways API provides endpoints to retrieve putaway records and their associated files. Available actions include listing all putaways, retrieving a specific putaway by its identifier, and downloading attachments associated with a putaway.
Manage WineSitting Orders
The Orders API allows developers to create, retrieve, and delete orders, as well as manage delivery logistics and attachments. Key capabilities include:
- Listing and Retrieval: Get all orders (using shared pagination) or retrieve a specific order.
- Order Creation: Create new orders. If the
delivery_dateis omitted, WineSitting automatically assigns the earliest valid delivery date. - Order Deletion: Delete orders, provided the order is not already in the 'preparation' stage.
- Attachments: Upload one or more files to an order, but only while the order status is
NEW. Attachments can also be downloaded.
Calculate Order Delivery Costs and Availability
To determine delivery logistics for an order, you must send a complete order payload to the following endpoints:
- Delivery Cost: Retrieve the accurate delivery cost for the specific order payload.
- Time Slots: Retrieve available delivery time slots for the order.
- Earliest Delivery Date: Determine the earliest possible date the order can be delivered.
- Invalid Dates: Retrieve a list of invalid delivery dates from the current year through the following year for the supplied order.
Configure WineSitting Webhooks for order events
Webhooks allow you to receive asynchronous notifications when events occur during the order process (e.g., when an order is delivered).
Configuration: Webhooks are configured in the API REST account settings of the Dashboard at
https://app.winesitting.com/bearers. You must provide a dedicated URL on your server to receive HTTP POST requests.Response Requirements:
- Your endpoint must return a
2xxHTTP status code to acknowledge receipt. - WineSitting uses a 'fire and forget' pattern; it ignores the request body/headers of your response.
- There is currently no retry policy if the delivery fails.
- Your endpoint must return a
Get started with the WineSitting API
The WineSitting API allows you to connect external systems to your WineSitting account. To begin, you need access to a WineSitting account, the target environment, and a valid API key. API keys should be kept secure and never committed to source control or exposed in client-side code.Understand WineSitting logistic references
When retrieving the cellar as consolidated wine, format, and packaging references, WineSitting uses a specific logistic reference format:wine_id|format|box. For example:1234|0.75|bottles.Retrieve a specific warehouse by ID
Retrieve details for a specific warehouse using its unique identifier. The request requires a Bearer token for authentication.GET /warehouses/:idRetrieve the authenticated account
To make your first functional API request, retrieve the account details associated with your API key by calling the/accountendpoint.curl --request GET \ --url "https://app.winesitting.com/api/v2/account" \ --header "Accept: application/json" \ --header "Authorization: Bearer YourBearerToken"Check WineSitting API availability
Verify if the WineSitting API is available by calling the status endpoint. A successful response indicating the API is available is an empty JSON array.Retrieve all bottles in the cellar
Use the 'Get all bottles' endpoint to retrieve the cellar in consolidated form. Note that this specific endpoint is not paginated.Authenticate requests using Bearer tokens
WineSitting uses the Bearer authentication scheme. API keys can be generated and managed via the WineSitting dashboard. The token must be included in theAuthorizationheader of every request.Authorization: Bearer YourBearerTokenUpdate a specific address
Update an existing address by sending a PUT request to/addresses/:id. When updating, you must send all address fields, including those that remain unchanged.PUT /addresses/:id