/
Addresses

Addresses

The Addresses resource manages a customer's addresses. A webshop can configure which addresses they allow.
View more information about the allowed addresses >>

Types of addresses :

  • 1 : Delivery addresses

  • 2 : Invoice addresses

A customer may have multiple addresses of each type.

Default addresses

One address in each type can be flagged as a default address. This default address is considered the main address of it's address type and will be suggested by default to the customer (and used as default if the customer doesn't choose another one).

If an address is created or updated with the default address set, then the previous default one is unmarked.

However, it's possible that there is no default address. It's an ease for the customer, but it has not be designed as something required to use.


Modifier

Get addresses

Get the addresses list of the customer.

It may be the full list, or the list of each type.

Example

https://wsmedia.tlsecure.com/api/json/00000/customer/address?type=1

Modifier

Request

Parameters

Location

Type

Required

Default

Accepted

Parameters

Location

Type

Required

Default

Accepted

token

Header

String(26)

v

 

 

type

Path

Integer

 

0

address types

Modifier

Response

Success

{ "response": { "success": true "message": "addresses list retrieved" "object": { "addresses": { "address": [2] 0: { "id": 1 "user": 586 "type": 1 "title": "Mr" "firstName": "Hulk" "lastName": "Hulk" "addressLine1": "Victoria Street" "number": 15 "postcode": "255623" "city": "New York" "country": 2 "default": false } 1: { "id": 2 "user": 586 "type": 1 "title": "Mr" "firstName": "Spider" "lastName": "Man" "addressLine1": "Lincoln Street" "number": 179 "postbus": "A" "postcode": "253" "city": "New York" "country": 2 "default": false }   } } } }

Error

{ "response": { "success": false "code": 3 "message": "No token with that key" } }

Codelist

Code

Success

Message

Code

Success

Message

0

v

getting addresses list

1

 

domaincode malformed

2

 

connexion error

3

 

token is empty

4

 

no token with that key

5

 

invalid token

9

 

{param} is not {type} {(or undefined)}

10

v

no addresses

11

 

incorrect address type

99

 

uncatched exception


Modifier

Create address

Example

https://wsmedia.tlsecure.com/api/json/00000/customer/address

Modifier

Request

Parameters

Location

Type

Required

Default

Accepted

Parameters

Location

Type

Required

Default

Accepted

token

Header

String(26)

v

 

 

type

Form

Integer

v

 

address types

title

Form

String

 

 

 

firstName

Form

String

v

 

 

prefix

Form

String

 

 

 

lastName

Form

String

v

 

 

addressLine1

Form

String

v

 

 

number

Form

Integer

 

 

 

postbus

Form

String

 

 

 

addressLine2

Form

String

 

 

 

addressLine3

Form

String

 

 

 

postcode

Form

String

v

 

 

city

Form

String

v

 

 

country

Form

Integer

v

 

countries

phone

Form

String

 

 

 

cellphone

Form

String

 

 

 

default

Form

Boolean

 

false

 

companyName

Form

String

 

 

 

number and postbus are not mandatory fields.

However, the number is required by some carrier ; so better fill it.

Modifier

Response

Success

{ "response": { "success": true "message": "address created" "object": { "address": { "id": 1 "user": 586 "type": 1 "title": "Mr" "firstName": "Bruce" "lastName": "Banner" "addressLine1": "Victoria Street" "number":15 "postcode": "10007" "city": "New York" "country": 2 "default": false "companyName": "Tite Live" } } } }

Error

Codelist

Code

Success

Message

Code

Success

Message

0

v

address created

1

 

domaincode malformed

2

 

connexion error

3

 

token is empty

4

 

no token with that key

5

 

invalid token

9

 

{param} is not {type} {(or undefined)}

99

 

uncatched exception


Modifier

Update address

Example

https://wsmedia.tlsecure.com/api/json/00000/customer/address/52

Modifier

Request

Parameters

Location

Type

Required

Default

Accepted

Parameters

Location

Type

Required

Default

Accepted

token

Header

String(26)

v

 

 

Content-Type

Header

String

v

 

application/x-www-form-urlencoded

address (ID)

URL

Long

v

 

 

title

Form

String

 

 

 

firstName

Form

String

 

 

 

prefix

Form

String

 

 

 

lastName

Form

String

 

 

 

addressLine1

Form

String

 

 

 

number

Form

Integer

 

 

 

postbus

Form

String

 

 

 

addressLine2

Form

String

 

 

 

addressLine3

Form

String

 

 

 

postcode

Form

String

 

 

 

city

Form

String

 

 

 

country

Form

Integer

 

 

countries

phone

Form

String

 

 

 

cellphone

Form

String

 

 

 

default

Form

Boolean

 

false

 

companyName

Form

String

 

 

 

Modifier

Response

Success

Error

Codelist

Code

Success

Message

Code

Success

Message

0

v

address updated

1

 

domaincode malformed

2

 

connexion error

3

 

token is empty

4

 

no token with that key

5

 

invalid token

9

 

{param} is not {type} {(or undefined)}

10

 

address not exist

11

 

address in cart - no postal charges available

99

 

uncatched exception


Modifier

Delete address

It may be the full list, or the list of each type.

Example

https://wsmedia.tlsecure.com/api/json/00000/customer/address/81

Modifier

Request

Parameters

Location

Type

Required

Default

Accepted

Parameters

Location

Type

Required

Default

Accepted

token

Header

String(26)

v

 

 

address

URL

Long

v

 

 

Modifier

Response

Success

Error

Codelist

Code

Success

Message

Code

Success

Message

0

v

address updated

1

 

domaincode malformed

2

 

connexion error

3

 

token is empty

4

 

no token with that key

5

 

invalid token

9

 

{param} is not {type} {(or undefined)}

10

 

address not exist

99

 

uncatched exception

Related content