Zoey REST API reference ยท Interactive version: apidocs.zoey.com

Customers

Customers: Addresses

Get

GET https://container-url.zoeysite.com/api/rest/customers2/customer_address?id=1

Allows you to retrieve an existing customer address.

The list of attributes that will be returned for customer address is configured in the Admin Panel. The Customer user type has access only to his/her own addresses. Also, Admin can add additional non-system customer address attributes by selecting Customers > Attributes > Manage Customer Address Attributes (available only in Magento Enterprise Edition). If these attributes are set as visible on frontend, they will be returned in the response.

Query parameters:

NameExampleNotes
id1Address ID.

Example response (Get), HTTP 200:

{
    "entity_id": "6268",
    "firstname": "Zoey",
    "lastname": "Developer",
    "company": "Zoey Inc.",
    "city": "New York",
    "country_id": "US",
    "region": "New York",
    "postcode": "10019",
    "telephone": "(555) 555-5555",
    "street": [
        "123 Main St.",
        "Floor 10"
    ],
    "is_default_billing": 1,
    "is_default_shipping": 1
}

Get All

GET https://container-url.zoeysite.com/api/rest/customers/:customerId/addresses

Allows you to retrieve the list of existing customer addresses.

The list of attributes that will be returned for customer addresses is configured in the Zoey Admin Panel. The Customer user type has access only to his/her own addresses. Also, Admin can add additional non-system customer address attributes by selecting Customers > Attributes > Manage Customer Address Attributes. If these attributes are set as visible on frontend, they will be returned in the response.

Example response (Get All), HTTP 200:

[
    {
        "entity_id": "2",
        "firstname": "Zoey",
        "lastname": "Dev",
        "company": "Zoey Inc.",
        "city": "New York",
        "region": "New York",
        "postcode": "10019",
        "country_id": "US",
        "telephone": "(555) 555-5555",
        "street": [
            "123 Main St."
        ],
        "is_default_billing": 1,
        "is_default_shipping": 1
    }
]

Create

POST https://container-url.zoeysite.com/api/rest/customers2/customer_address

Allows you to create a new address for the required customer.

The Customer user type can create addresses only for themselves.

Parameter Type Description
address_type string billing, shipping, or billing,shipping
email string email
prefix string Name prefix. (Mrs., Mr.)
firstname string First name.
middlename string Middle name.
lastname string Last name.
suffix string Name suffix. (Sr., Jr.)
company string Address company.
street string Address street. Separate lines using \n.
city string Address city.
region string Address region, state, or providence.
postcode string Postal or zipcode.
country_id string Country ID. (US, UK)
vat_id string VAT ID.
telephone string Telephone.
fax string Fax number.

Example request body:

{
    "customer_id": "1",
    "addressData": {
        "company": "Zoey Inc.",
        "firstname": "Zoey",
        "lastname": "Developer",
        "street": [
            "123 Main St.",
            "Floor 10"
        ],
        "city": "New York",
        "region": "New York",
        "country_id": "US",
        "postcode": "10019",
        "telephone": "(555) 555-5555",
        "is_default_billing": 1,
        "is_default_shipping": 1
    }
}

Update

PUT https://container-url.zoeysite.com/api/rest/customers2/customer_address

Allows you to update an existing customer address.

The list of attributes that will be updated for customer address is configured in the Admin Panel. The Customer user type has access only to his/her own addresses.

Only need to append the changes to the request.

Parameter Type Description
email string email
prefix string Name prefix. (Mrs., Mr.)
firstname string First name.
middlename string Middle name.
lastname string Last name.
suffix string Name suffix. (Sr., Jr.)
company string Address company.
street string Address street. Separate lines using \n.
city string Address city.
region string Address region, state, or providence.
postcode string Postal or zipcode.
country_id string Country ID. (US, UK)
vat_id string VAT ID.
telephone string Telephone.
fax string Fax number.

Example request body:

{
    "addressId": "10",
    "addressData": {
        "firstname": "API TEST"
    }
}

Delete

DELETE https://container-url.zoeysite.com/api/rest/customers/addresses/:addressId

Allows you to delete an existing customer address.

The Customer user type can delete only his/her own addresses.

Countries

GET https://container-url.zoeysite.com/api/rest/address/countries

Used to set the different address types to the cart.

Types

Use the example requests to configure the addresses as needed.

Example request body:

{
    "cartId": "287",
    "customerAddressData": [
        {
            "mode": "billing",
            "address_id": "1"
        },
        {
            "mode": "shipping",
            "address_id": "1"
        }
    ]
}

Country By ID

GET https://container-url.zoeysite.com/api/rest/address/countries/:country_id

Used to set the different address types to the cart.

Types

Use the example requests to configure the addresses as needed.

Example request body:

{
    "cartId": "287",
    "customerAddressData": [
        {
            "mode": "billing",
            "address_id": "1"
        },
        {
            "mode": "shipping",
            "address_id": "1"
        }
    ]
}