Addresses
The Addresses resource family provides access to addresses for shoppers and accounts. With this resource you can retrieve, edit, create and set default billing and shipping addresses.
Billing Addresses versus Shipping Addresses
Currently, you cannot create an address
and label it as a shipping only address or a billing
only address. Cortex does not make a distinction between the shipping and billing addresses.
Read Billing Addresses retrieves a list of all the shopper or account addresses; similarly,
Read Shipping Addresses retrieves a list of all the shopper or account addresses.
Read Addresses for Profile
Read list of the shopper’s addresses.
Workflow
- Start with profile
GET
the link with rel: addresses- Render the response
Read Addresses for Account
Read list of the account’s addresses.
Workflow
- Start with account
GET
the link with rel: addresses- Render the response
Read Address
Read an address from a list of addresses.
Workflow
- Start with profile addresses or account addresses
GET
the link with rel: element- Render the response
Response
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Sample
{
"self": {
"type": "addresses.address",
"uri": "/addresses/mobee/gazdcnbumu2teljwgntgkljugbrgcllcge3tellbgm3tqnjygaydkylemu=",
"href": "https://cortex.elasticpath.com/cortex/addresses/mobee/gazdcnbumu2teljwgntgkljugbrgcllcge3tellbgm3tqnjygaydkylemu="
},
"messages": [],
"links": [
{
"rel": "list",
"type": "addresses.addresses",
"href": "https://cortex.elasticpath.com/cortex/addresses/mobee"
},
{
"rel": "profile",
"type": "profiles.profile",
"href": "https://cortex.elasticpath.com/cortex/profiles/mobee/ovzwk4tumvzxiz3vnfsa="
}
],
"address": {
"country-name": "CA",
"extended-address": null,
"locality": "Vancouver",
"postal-code": "VVV VVV",
"region": "BC",
"street-address": "1 Test St"
},
"name": {
"family-name": "user",
"given-name": "test"
},
"organization": null,
"phone-number": "7781112111"
}
Read Shipping Addresses
Read list of the customer’s shipping addresses.
Workflow
- Start with profile addresses or account addresses
GET
the link with rel: shippingaddresses- Render the response
Read Shipping Address
Read a shipping address from a list of shipping addresses.
Workflow
- Start with shipping addresses
GET
the link with rel: element- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Default Shipping Address
Read the customer’s default shipping addresses.
Workflow
- Start with shipping addresses
GET
the link with rel: default- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Chosen Default Shipping Address
Use the default shipping address selector to read the chosen default shipping address.
Workflow
- Start with shipping addresses
GET
the link with rel: selectorGET
the link with rel: chosenGET
the link with rel: description- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Default Shipping Address Choice
Use the default shipping address selector to read a default shipping address choice.
Workflow
- Start with shipping-addresses
GET
the link with rel: selectorGET
the link with rel: choiceGET
the link with rel: description- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Select Default Shipping Address
Use the default shipping address selector to choose the default shipping address.
Workflow
- Start with shipping addresses
GET
the link with rel: selectorGET
the link with rel: choicePOST
the choice using the link with rel: selectaction
Read Billing Addresses
Read a list of the customer’s billing addresses.
Workflow
- Start with profile addresses or account addresses
GET
the link with rel: billingaddresses- Render the response
Read Billing Address
Read billing addresses from the list of billing addresses.
Workflow
- Start with billing addresses
GET
the link with rel: element- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Default Billing Address
Read the customer’s default billing addresses.
Workflow
- Start with billing addresses
GET
the link with rel: default- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Chosen Default Billing Address
Use the default billing address selector to read the chosen default billing address.
Workflow
- Start with billing addresses
GET
the link with rel: selectorGET
the link with rel: chosenGET
the link with rel: description- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Read Default Billing Address Choice
Use the default billing address selector to read a default billing address choice.
Workflow
- Start with billing addresses
GET
the link with rel: selectorGET
the link with rel: choiceGET
the link with rel: description- Render the response
Response Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |
Select Default Billing Address
Use the default billing address selector to select the default billing address.
Workflow
- Start with billing addresses
GET
the link with rel: selectorGET
the link with rel: choicePOST
the choice using the link with rel: selectaction
Delete Address
If the address was selected to use in an order and the address is deleted, the order shows a NeedInfo link.
Workflow
- Start with address
DELETE
address
Update Address
Make changes to an existing address.
Workflow
- Start with address
- Edit the address object with new details
- Update address using a
PUT
request
Add Address
Create an address.
Workflow
- Start with profile addresses or account addresses
GET
the link with rel: addressform- Fill out the form
POST
the form using the link with rel: createaddressaction
Request Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | An extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | The region name. A region typically corresponds to a province or a state of a country. | string |
postal-code | The postal code or zip code. | string |
country-name | The country name. | string |
phone-number | The phone number. | string |
organization | The organization. | string |