Orders
Get All Orders
HTTP Request
GET /orders
Query Parameters
See pagination
Response informations
Status list : see Enums
Construct tracking url page :
https://winesitting.aftership.com/{myTrackingNumber}?lang=fr
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
[
{
"id": 109951,
"comment": "ABCD",
"is_pickup": true,
"address": null,
"pickup_warehouse": {
"id": 6,
"public_name": "WineSitting Chilly-Mazarin",
"street1": "2 rue Guynemer",
"street2": "",
"city": "Chilly-Mazarin",
"zipcode": "91380",
"country": "FR"
},
"warehouse": {
"id": 6,
"public_name": "WineSitting Chilly-Mazarin",
"street1": "2 rue Guynemer",
"street2": "",
"city": "Chilly-Mazarin",
"zipcode": "91380",
"country": "FR"
},
"attachments": [],
"delivery_slip": null,
"delivery_date": {
"date": "2024-09-11 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"delivery_start": "07:30",
"delivery_end": "16:30",
"preparation_date": {
"date": "2024-09-10 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"tracking_url": null,
"tracking_numbers": [],
"status": {
"value": 0,
"name": "NEW",
"label": "En attente de préparation"
},
"additional_status": null,
"reference": null,
"origin": "API",
"created_by": "Test Test",
"updated_by": "Test Test",
"created_at": {
"date": "2024-09-09 18:05:12.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"updated_at": {
"date": "2024-09-09 18:05:14.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"content": [
{
"id": 78545,
"wine": "Le Nez de Goth & Bieres Ney",
"color": "Biere",
"country": "FR",
"region": "Jura",
"appelation": "Biere",
"description": "Trousotte",
"ranking": null,
"millesime": 2020,
"alcohol": 5,
"format": 0.33,
"price": null,
"comment": null,
"quantity": 1,
"box": "bottles",
"reference": "78545|0.33|bottles"
}
]
},
{
"id": 109930,
"comment": null,
"is_pickup": false,
"address": {
"id": 245321,
"firstname": "Dupont",
"lastname": "Dupond",
"company": "Chateau de Mille Sabords",
"street1": "86 rue Baron le Roy",
"street2": null,
"city": "Paris",
"zipcode": "75012",
"country": "FR",
"phone": "0981417202",
"email": null,
"vat_number": null,
"detail": null,
"reference": null
},
"pickup_warehouse": null,
"warehouse": {
"id": 4,
"public_name": "WineSitting Wissous B",
"street1": "14/16 bd Arago",
"street2": "",
"city": "Wissous",
"zipcode": "91320",
"country": "FR"
},
"attachments": [],
"delivery_slip": null,
"delivery_date": {
"date": "2024-07-19 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"delivery_start": "13:00",
"delivery_end": "17:00",
"preparation_date": {
"date": "2024-07-18 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"tracking_url": null,
"tracking_numbers": [],
"status": {
"value": 0,
"name": "NEW",
"label": "En attente de préparation"
},
"additional_status": null,
"reference": null,
"origin": "WEB",
"created_by": "Test Test",
"updated_by": "Test Test",
"created_at": {
"date": "2024-06-26 17:02:17.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"updated_at": {
"date": "2024-07-18 19:17:17.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"errors": null,
"content": [
{
"id": 104278,
"wine": "Chateau De Briace",
"color": "Blanc",
"country": "FR",
"region": "Loire",
"appelation": "Muscadet Sevre et Maine",
"description": null,
"ranking": null,
"millesime": 2022,
"alcohol": 13,
"format": 1.5,
"price": null,
"comment": null,
"quantity": 2,
"box": "CBO6",
"reference": "104278|1.5|CBO6"
}
]
}
]
Get a Specific Order
HTTP Request
GET /orders/{id}
Query Parameters
Parameter | Description |
---|---|
id | The id of the Order to retrieve |
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders/109930' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
{
"id": 109930,
"comment": null,
"is_pickup": false,
"address": {
"id": 245321,
"firstname": "Dupont",
"lastname": "Dupond",
"company": "Chateau de Mille Sabords",
"street1": "86 rue Baron le Roy",
"street2": null,
"city": "Paris",
"zipcode": "75012",
"country": "FR",
"phone": "0981417202",
"email": null,
"vat_number": null,
"detail": null,
"reference": null
},
"pickup_warehouse": null,
"warehouse": {
"id": 4,
"public_name": "WineSitting Wissous B",
"street1": "14/16 bd Arago",
"street2": "",
"city": "Wissous",
"zipcode": "91320",
"country": "FR"
},
"attachments": [],
"delivery_slip": null,
"delivery_date": {
"date": "2024-07-19 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"delivery_start": "13:00",
"delivery_end": "17:00",
"preparation_date": {
"date": "2024-07-18 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"tracking_url": null,
"tracking_numbers": [],
"status": {
"value": 0,
"name": "NEW",
"label": "En attente de préparation"
},
"additional_status": null,
"reference": null,
"origin": "WEB",
"created_by": "Test Test",
"updated_by": "Test Test",
"created_at": {
"date": "2024-06-26 17:02:17.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"updated_at": {
"date": "2024-07-18 19:17:17.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"errors": null,
"content": [
{
"id": 104278,
"wine": "Chateau De Briace",
"color": "Blanc",
"country": "FR",
"region": "Loire",
"appelation": "Muscadet Sevre et Maine",
"description": null,
"ranking": null,
"millesime": 2022,
"alcohol": 13,
"format": 1.5,
"price": null,
"comment": null,
"quantity": 2,
"box": "CBO6",
"reference": "104278|1.5|CBO6"
}
]
}
Create an Order
POST /orders
Order parameters
Name | Required | Type | Details |
---|---|---|---|
delivery_date | optional | string | Format : YYYY-MM-DD . If delivery_date is missing, the system will choose the best delivery date for you. If you set the delivery_date , you must follow some rules (see below). |
delivery_start | optional | string | Format : HH:ii . The start time of the delivery slot. Defaults to the start of first delivery mode time slot. |
delivery_end | optional | string | Format : HH:ii . The end time of the delivery slot. Defaults to the end of first delivery mode time slot. |
pickup | optional | bool | Default : true . It means that the order will be picked up at warehouse. If you set the value to false , you must provide an address. |
comment | optional | string | A comment about your order. |
reference | optional | string | Your order reference. |
allow_partial_fulfillment | optional | bool | Default : false . If true the system will select maximum quantity of bottles even if asked quantity isn't available instead of failing for whole order. |
address | optional | Address | See Address. |
content | required | array | The content of your order. |
Order content
The content
parameter will look like below :
{
...
"content" : [
{
"reference": "12345|0.75|bottles",
"quantity": 6
},
{
"reference": "12345|0.75|CTO6",
"quantity": 4
},
{
"reference": "45678|0.33|bottles",
"quantity": 60
}
],
...
}
Unless you set allow_partial_fulfillment
, you can only ask for bottles that are in your cellar (in sufficient quantity). If you don't meet this requirement, you will get an error and the order will not be created.
The shortest delay between delivery and order creation is computed with the following algorithm :
- Preparation
- If the order is created before 1pm, the preparation will start the same day.
- If the order is created after 1pm the preparation will start the next day.
- The preparation starts only on working day. If the previous rules lead to a start on saturday, we will start on monday.
- Shipping will add days to the delay thanks to the following rules :
- 1 day for 75, 92, 93, 94, 28, 45, 60, 77, 78, 91, 94, 95 departments
- 3 days for France (up to 24 bottles)
- 4 days for France (above 24 bottles)
- 6 days or the rest of the world
- The delivery can be done only on working day. If the previous delay leads to a delivery on saturday, we will add some delay for a monday delivery.
You can't ask for a delivery on an invalid date. If you do it, you will get an error.
Example
- Request
- Response
$ curl --request POST --url 'https://app.winesitting.com/api/v2/orders' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \
--data '
{
"content": [
{
"reference": "104278|0.75|bottles",
"quantity": 6
},
{
"reference": "104278|1.5|CBO6",
"quantity": 6
}
],
"allow_partial_fulfillment": true,
"pickup": false,
"address": {
"firstname": "Test",
"lastname": "Test",
"street1": "86 rue Baron le Roy",
"city": "Paris",
"zipcode": "75012",
"country": "FR",
"phone": "+33123456789"
}
}
'
{
"id": 109956,
"comment": null,
"is_pickup": false,
"address": {
"id": 245327,
"firstname": "Test",
"lastname": "Test",
"company": null,
"street1": "86 rue Baron le Roy",
"street2": null,
"city": "Paris",
"zipcode": "75012",
"country": "FR",
"phone": "+33123456789",
"email": null,
"vat_number": null,
"detail": null,
"reference": null
},
"pickup_warehouse": {
"id": 4,
"public_name": "WineSitting Wissous B",
"street1": "14/16 bd Arago",
"street2": "",
"city": "Wissous",
"zipcode": "91320",
"country": "FR"
},
"warehouse": {
"id": 4,
"public_name": "WineSitting Wissous B",
"street1": "14/16 bd Arago",
"street2": "",
"city": "Wissous",
"zipcode": "91320",
"country": "FR"
},
"attachments": [],
"delivery_slip": null,
"delivery_date": {
"date": "2024-08-20 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"delivery_start": "02:00",
"delivery_end": "04:00",
"preparation_date": {
"date": "2024-08-19 00:00:00.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"tracking_url": null,
"tracking_numbers": [],
"status": {
"value": 0,
"name": "NEW",
"label": "En attente de préparation"
},
"additional_status": null,
"reference": null,
"origin": "WEB",
"created_by": "Test Test",
"updated_by": "Test Test",
"created_at": {
"date": "2024-07-15 15:30:20.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"updated_at": {
"date": "2024-08-19 12:43:49.000000",
"timezone_type": 3,
"timezone": "Europe/Paris"
},
"content": [
{
"id": 104278,
"wine": "Chateau De Briace",
"color": "Blanc",
"country": "FR",
"region": "Loire",
"appelation": "Muscadet Sevre et Maine",
"description": null,
"ranking": null,
"millesime": 2022,
"alcohol": 13,
"format": 0.75,
"price": null,
"comment": null,
"quantity": 6,
"box": "bottles",
"reference": "104278|0.75|bottles"
},
{
"id": 104278,
"wine": "Chateau De Briace",
"color": "Blanc",
"country": "FR",
"region": "Loire",
"appelation": "Muscadet Sevre et Maine",
"description": null,
"ranking": null,
"millesime": 2022,
"alcohol": 13,
"format": 1.5,
"price": null,
"comment": null,
"quantity": 3,
"box": "CBO6",
"reference": "104278|1.5|CBO6"
}
],
"errors": [
{
"reference": "104278|1.5|CBO6",
"ordered": 6,
"available": 3
}
]
}
Edit an Order
We don't provide an endpoint to edit an order. You must delete the order and create a new one.
Delete an Order
HTTP Request
DELETE /orders/{id}
You can't delete an order that is already in preparation.
Example
- Request
- Response
$ curl --request DELETE --url 'https://app.winesitting.com/api/v2/orders/24079' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \
The deleted Order
Get delivery cost
This endpoint retrieves delivery cost for an order.
HTTP Request
GET /orders/delivery-cost
Parameters
In order to have an accurate delivery cost, you must provide a complete order. The request payload is the same as the Create an Order endpoint.
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders/delivery-cost?is_pickup=0&zipcode=95300&bottle_quantity=24&country=FR&delivery_date=2023-12-23' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
--data '
{
Order payload
}
{
"cost": 10
}
Get Earliest Delivery Date
This endpoint gives you the earliest delivery date for an order.
HTTP Request
GET /orders/earliest-delivery-date
Parameters
The request payload is the same as the Create an Order endpoint.
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders/earliest-delivery-date' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
--data '
{
Order payload
}
{
"earliest_delivery_date": "2024-09-11"
}
Get Invalid Dates
This endpoint gives you all invalid dates for current year to year+1.
HTTP Request
GET /orders/invalid-dates
Parameters
The request payload is the same as the Create an Order endpoint.
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders/invalid-dates' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
--data '
{
Order payload
}
{
"invalid_dates": [
"2024-04-01",
"2024-05-01",
"..."
]
}
Send attachement
HTTP Request
POST /orders/{id}/files
Query Parameters
You must use multipart/form-data and send files, the parameter name must be "files"
Important notes
File formats allowed :
- text/csv
- application/msword
- image/gif
- text/html
- image/jpeg
- application/vnd.oasis.opendocument.spreadsheet
- application/vnd.oasis.opendocument.text
- application/vnd.oasis.opendocument.text
- application/pdfapplication/pdf
- application/pdf
- application/vnd.ms-powerpoint
- application/rtf
- application/vnd.ms-excel
- image/bmp
- image/png
- application/mspowerpoint
Example
- Request
- Response
$ curl --request POST --url 'https://app.winesitting.com/api/v2/orders/24079/files' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'\
--form 'files=@"my-attachment-original-name-1.pdf"'
The order object with the new attachment