Addresses
Get All Addresses
This endpoint retrieves all addresses associated to current user.
HTTP Request
GET /v1/addresses
Query Parameters
Parameter | Default | Description |
---|---|---|
page | 1 | The current page |
count | 30 | The number of items per page |
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/v1/addresses' \
--header 'AccessKey: YourAccessKey' \
--header 'SecretKey: YourSecretKey' \
--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": "ROYAUME-UNI",
"phone": "+44 132 456 798",
"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": "GAULE",
"phone": "02 34 56 78 91",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
]
Get a Specific Address
This endpoint retrieves a specific address.
HTTP Request
GET /v1/addresses/{id}
URL Parameters
Parameter | Description |
---|---|
id | The id of the address to retrieve |
info
You can't get a specific address that you don't own.
Example
- Request
- Response
$ curl --request GET --url 'https://app.winesitting.com/v1/addresses/2531' \
--header 'AccessKey: YourAccessKey' \
--header 'SecretKey: YourSecretKey' \
--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": "ROYAUME-UNI",
"phone": "+44 132 456 798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
Create an Address
This endpoint creates an address.
HTTP Request
POST /v1/addresses
Address parameters
Name | Required | Type | Details |
---|---|---|---|
firstname | required | string | Not required if company is given |
lastname | required | string | Not required if company is given |
company | required | string | Not required if firstname and lastname are given |
street1 | required | string | |
street2 | optional | string | |
city | required | string | |
zipcode | required | string | |
country | optional | string | ISO 3166-1 alpha-2 |
phone | required | string | |
optional | string | ||
vat_number | optional | string | |
detail | optional | string | Details about the address |
reference | optional | string | Your reference |
Example
- Request
- Response
$ curl --request POST --url 'https://app.winesitting.com/v1/addresses' \
--header 'AccessKey: YourAccessKey' \
--header 'SecretKey: YourSecretKey' \
--header 'content-type: application/json' \
--data '
{
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"city": "Londres",
"zipcode": "AB10 1",
"phone": "+44 132 456 798",
},
'
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 1",
"country": "ROYAUME-UNI",
"phone": "+44 132 456 798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
}
Edit an Address
This endpoint lets you edit an address.
HTTP Request
PUT /v1/addresses/{id}
Address parameters
Name | Required | Type | Details |
---|---|---|---|
firstname | optional | string | |
lastname | optional | string | |
company | optional | string | |
street1 | optional | string | |
street2 | optional | string | |
city | optional | string | |
zipcode | optional | string | |
country | optional | string | ISO 3166-1 alpha-2 |
phone | optional | string | |
optional | string | ||
vat_number | optional | string | |
detail | optional | string | Details about the address |
reference | optional | string | Your reference |
info
All fields are optional, but an address still needs (a firstname
and a lastname
) or a company
.
Example
- Request
- Response
$ curl --request PUT --url 'https://app.winesitting.com/v1/addresses/2531' \
--header 'AccessKey: YourAccessKey' \
--header 'SecretKey: YourSecretKey' \
--header 'content-type: application/json' \
--data '
{
"zipcode": "AB10 2",
"firstname": "Sherlock"
},
'
{
"id": 2531,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 2",
"country": "ROYAUME-UNI",
"phone": "+44 132 456 798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}
Delete an Address
This endpoint lets you delete an Address.
HTTP Request
DELETE /v1/addresses/{id}
info
You can't delete an address that you don't own. You can't delete your billing address.
Example
- Request
- Response
$ curl --request DELETE --url 'https://app.winesitting.com/v1/address/2531' \
--header 'AccessKey: YourAccessKey' \
--header 'SecretKey: YourSecretKey' \
--header 'content-type: application/json' \
{
"id": null,
"firstname": "Sherlock",
"lastname": "Holmes",
"company": "Sherlock Holmes Investigation Ltd.",
"street1": "221b Baker Street",
"street2": null,
"city": "Londres",
"zipcode": "AB10 2",
"country": "ROYAUME-UNI",
"phone": "+44 132 456 798",
"email": "email@domain.tld",
"vat_number": null,
"detail": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"reference": "My reference"
}