Skip to main content
Version: v2

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

$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'

Get a Specific Order

HTTP Request

GET /orders/{id}

Query Parameters

ParameterDescription
idThe id of the Order to retrieve

Example

$ curl --request GET --url 'https://app.winesitting.com/api/v2/orders/109930' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'

Create an Order

POST /orders

Order parameters

NameRequiredTypeDetails
delivery_dateoptionalstringFormat : 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_startoptionalstringFormat : HH:ii. The start time of the delivery slot. Defaults to the start of first delivery mode time slot.
delivery_endoptionalstringFormat : HH:ii. The end time of the delivery slot. Defaults to the end of first delivery mode time slot.
pickupoptionalboolDefault : true. It means that the order will be picked up at warehouse. If you set the value to false, you must provide an address.
commentoptionalstringA comment about your order.
referenceoptionalstringYour order reference.
allow_partial_fulfillmentoptionalboolDefault : false. If true the system will select maximum quantity of bottles even if asked quantity isn't available instead of failing for whole order.
addressoptionalAddressSee Address.
contentrequiredarrayThe 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.

warning
We strongly advice you to let WineSitting compute the earliest delivery date. If not, you will have to follow rules bellow.

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

$ 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"
}
}
'

Edit an Order

info

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}

info

You can't delete an order that is already in preparation.

Example

$ curl --request DELETE --url 'https://app.winesitting.com/api/v2/orders/24079' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \

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

$ 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
}

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

$ 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
}

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

$ 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
}

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

$ 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"'