Addresses
Get All Addresses
This endpoint retrieves all addresses associated to current user.
HTTP Request
GET /addresses
Query Parameters
See pagination
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/addresses' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
[
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
},
{
"id": 1429,
"firstname": "Astérix",
"lastname": "Obelix",
"company": "La Gauloise du Sanglier",
"street1": "Village insoumis",
"street2": null,
"city": "Armorique",
"zipcode": "59000",
"country": "FR",
"phone": "+33234567891",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
]
Get a Specific Address
HTTP Request
GET /addresses/{id}
Query Parameters
Parameter | Description |
---|---|
id | The id of the address to retrieve |
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/api/v2/addresses/2531' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json'
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
Create an Address
HTTP Request
POST /addresses
Address parameters
Name | Required | Type | Details |
---|---|---|---|
firstname | required | string | Required unless company is provided |
lastname | required | string | Required unless company is provided |
company | required | string | Required unless both firstname and lastname are provided |
street1 | required | string | |
street2 | optional | string | |
city | required | string | |
zipcode | required | string | |
country | optional | string | ISO 3166-1 alpha-2 |
phone | required | string | E164 |
optional | string | ||
vat_number | optional | string | |
detail | optional | string | Details about the address (don't put delivery time slots) |
reference | optional | string | Your reference |
Example
- Request
- Response
$ curl --request POST --url 'https://app.winesitting.com/api/v2/addresses' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \
--data '
{
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My new reference"
},
'
{
"id": 2532,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My new reference"
}
Edit an Address
HTTP Request
PUT /addresses/{id}
info
The PUT
verb means that you have to send all the parameters, even the ones that don't change.
The parameters are the same as the Create an Address endpoint.
Example
- Request
- Response
$ curl --request PUT --url 'https://app.winesitting.com/api/v2/addresses/2531' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \
--data '
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
},
'
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
Delete an Address
HTTP Request
DELETE /addresses/{id}
info
You can't delete your billing address.
Example
- Request
- Response
$ curl --request DELETE --url 'https://app.winesitting.com/api/v2/address/2531' \
--header 'Authorization: Bearer YourBearerToken' \
--header 'content-type: application/json' \
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "GB",
"phone": "+44132456798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}