Customers

Customer Index Endpoint

Structure

See View Customer Endpoint for the structure of the customer payload inside the data array.

Filters

Name
Description
Example
emails Only return customers with specific emails ?emails=test@gmail.com,example@gmail.com
names Only return customers with specific names ?names=Test,Another Test
groups Only return customers with specific groups ?groups=VIP,Retail

Example Request

GET /api/customers?per_page=2

Example Response

{
    "current_page": 1,
    "data": [
        //...
    ],
    "first_page_url": "http://aero.test/api/customers?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://aero.test/api/customers?page=1",
    "next_page_url": null,
    "path": "http://aero.test/api/customers",
    "per_page": 2,
    "prev_page_url": null,
    "to": 1,
    "total": 1
}

See View Customer Endpoint for the structure of the customer payload inside the data array.

View Customer Endpoint

Structure

Customer

Name
Type
Description
id int The id of the customer
name string The name of the customer
email string The email of the customer
created_at timestamp The date that the customer was created at
group object The group the customer belongs to, see Group
addresses array An array of Address objects
tax_group object The Tax Group of the customer
additional_attributes object An array of Additional Attribute objects

Group

Name
Type
Description
id int The id of the customer group
name string The name of the customer group
tax_group object The tax group of the customer group, see Tax Group

Address

Name
Type
Description
name string The name of the address
first_name string The first name for the address
last_name string The last name for the address
company string The company for the address
mobile string The mobile number for the address
phone string The phone number for the address
line_1 string The first line for the address
line_2 string The second line for the address
city string The city for the address
county string The county for the address
zone string The zone code for the address
postcode string The postcode for the address
country string The country code for the address
reference string The unique reference for the address
eori_number string The EORI number for the address
is_default boolean Whether the address is default

Tax Group

Name
Type
Description
id int The id of the customer tax group
name string The name of the customer tax group

Additional Attributes

Name
Type
Description
key string The key of the additional attribute
value string The value of the additional attribute

Example Request

GET /api/customers/{id|email}

Example Response

{
    "id": 1,
    "name": "test test",
    "email": "test@gmail.com",
    "created_at": "2025-06-27T13:00:47.000000Z",
    "group": {
        "id": 1,
        "name": "test",
        "tax_group": {
            "id": 1,
            "name": "Retail Customer"
        }
    },
    "addresses": [
        {
            "id": 1,
            "name": null,
            "first_name": "test",
            "last_name": "test",
            "company": "test",
            "mobile": null,
            "phone": null,
            "line_1": "test",
            "line_2": null,
            "city": "test",
            "county": "Test",
            "zone": null,
            "postcode": "te57 10l",
            "country": "GB",
            "reference": null,
            "eori_number": null,
            "is_default": 0
        },
        {
            "id": 2,
            "name": null,
            "first_name": "test",
            "last_name": "test",
            "company": "test",
            "mobile": null,
            "phone": null,
            "line_1": "test",
            "line_2": null,
            "city": "test",
            "county": null,
            "zone": null,
            "postcode": "te57 10l",
            "country": "GB",
            "reference": null,
            "eori_number": null,
            "is_default": 1
        }
    ],
    "tax_group": null,
    "additional_attributes": []
}

Create Customer Endpoint

Structure

Customer

Name
Type
Description
Required
id int The id for the customer No
name string The name of the customer Yes
email string The email of the customer Yes
password string The plain-text password of the customer Conditional *
password_hash string The hashed password of the customer Conditional *
group string The group name of the customer No
tax_group string The tax group name of the customer No
addresses array The addresses of the customer, see Address No
additional_attributes array The additional attributes of the customer, see Additional Attribute No

* One of password or password_hash must be provided. Using password_hash is recommended. Ensure the hashing algorithm matches the store’s configuration (usually bcrypt).

Address

Name
Type
Description
Required
name string The name of the address No
first_name string The first name for the address Yes
last_name string The last name for the address Yes
company string The company for the address No
mobile string The mobile number for the address No
phone string The phone number for the address No
line_1 string The first line for the address Yes
line_2 string The second line for the address No
city string The city for the address Yes
county string The county for the address No
zone string The zone code for the address, required for some countries (e.g., US, AU, etc) Conditional
postcode string The postcode for the address, required for some countries (e.g., GB, US, etc) Conditional
country string The country code for the address Yes
reference string The unique reference for the address No
eori_number string The EORI number for the address No
is_default boolean Whether the address is default No

Additional Attribute

Name
Type
Description
Required
key string The key of the additional attribute Yes
value string The value of the additional attribute Yes

Example Request

POST /api/customers
{
    "name": "Test",
    "email": "test@gmail.com",
    "password_hash": "$2y$10$0QFHb4QU0wAsaskZPQv0Re72Xa2KXrWt5YR32O5aBxIwc0c41bbwm",
    "group": "Group Name",
    "addresses": [
        {
            "name": "API Address",
            "first_name": "test",
            "last_name": "test",
            "company": "test",
            "mobile": null,
            "phone": null,
            "line_1": "test",
            "line_2": null,
            "city": "test",
            "county" : "Test",
            "zone": null,
            "postcode": "te57 10l",
            "country": "GB",
            "reference": null,
            "eori_number": null,
            "is_default": true
        }
    ],
    "additional_attributes": [
        {
            "key": "api",
            "value": "true"
        }
    ]
}

Example Response

{
    "customer": {
        "id": 1
    }
}

Update Customer Endpoint

Structure

Customer

Name
Type
Description
Required
id int The id for the customer No
name string The name of the customer No
email string The email of the customer No
group string The group name of the customer No
tax_group string The tax group name of the customer No
additional_attributes array The additional attributes of the customer, see Additional Attribute No

Additional Attribute

Name
Type
Description
Required
key string The key of the additional attribute Yes
value string The value of the additional attribute Yes

Example Request

PUT /api/customers/{id|email}
{
    "name": "Test",
    "email": "test@gmail.com",
    "group": "Group Name",
    "additional_attributes": [
        {
            "key": "last-api-update",
            "value": "2023-09-01 09:29:41"
        }
    ]
}

Example Response

{
    "customer": {
        "id": 1
    }
}