Addresses
Endpoint supporting Customer Address creation, view, and deletion. An Address is a saved mailing address created by a user or synced from Southware
Fields
Address objects have several fields
url
- Type: url
- Read Only
This is a url to the retrieve endpoint for this address object.
nickname
- Type: String
- Max Length: 64
This is a user assignable nickname for the address. This will not be sent to southware.
address_type
- Type: choice
- Required
- Choices:
"shipto""billto""customer"
This attribute will specify the type of address it is. This only really relates to southware data and syncing back into southware
name
- Type: String,
- Required
- Max Length: 256
Item extend does some magic on the back end to try and split a name up into first name and last name.
address1
- Type: String
- Required
- Max Length: 256
Main address string.
address2
- Type: String
- Max Length: 256
Second Address Line.
address3
- Type: String
- Max Length: 256
Third Address Line.
city
- Type: String
- Required
- Max Length: 256
City name
state
- Type: String
- Required
- Max Length: 256
State Abbreviation
postal_code
- Type: String
- Required
- Max Length: 256
Postal Code
country
- Type: String
- Max Length: 256
Country Code
default
- Type: Boolean
whether this address is a default address or not. Default addresses can be either user or customer defaults. A user can only define a shipto and billto default.
Endpoints
List
GET /api/addresses/
List all Addresses in for the logged in user.
This endpoint has 2 filters:
address_type- Type: Choice: [
shipto,billto,customer] - Filter the result set by address type
- Type: Choice: [
default- Type: Choice: [
true,false] - show the default addresses or don't. this allows you to fetch all defaults associated with a user. This will include customer defaults and user defaults.
- Type: Choice: [
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "https://demo.itemextend.com/api/addresses/27113/",
"nickname": "",
"address_type": "shipto",
"name": "Test User",
"address1": "2909 Langford Rd.",
"address2": "#400B",
"address3": "",
"city": "Norcross",
"state": "GA",
"postal_code": "30071",
"country": "US",
"default": true
}
]
}
Create
POST /api/addresses/
{
"name":"Test User",
"address_type": "billto",
"address1": "2909 Langford Rd.",
"address2": "#400B",
"address3": "",
"city": "Norcross",
"state": "GA",
"postal_code": "30071",
"country": "US"
}
Create a new saved Address.
Retrieve
GET /api/addresses/:key/
Return an Address by primary key.
Update
PUT /api/addresses/:key/
{
"nickname": "",
"address_type": "shipto",
"name": "Alex Riviere",
"address1": "2909 Langford Rd.",
"address2": "#400B",
"address3": "",
"city": "Norcross",
"state": "GA",
"postal_code": "30071",
"country": "US"
}
Modify / replace an Address.
Partial Update
PATCH /api/addresses/:key/
{
"nickname": "Test Address"
}
Modify specific fields on an Address
Destroy
DELETE /api/addresses/:key/
Delete an Address.
