Address
Represents a physical or shipping address within the store system.
Type Definition
type Address {
name: String
email: String
firstName: String
lastName: String
company: String
companyId: String
vatNumber: String
vatId: String
phone: String
address1: String
address2: String
zipcode: String
city: String
stateCode: String
countryCode: String
info: String
latitude: String
longitude: String
}
Fields
Field | Type | Nullable | Description | Related Type |
---|---|---|---|---|
name | String | Yes | Full name of the person associated with this address | |
email | String | Yes | Email address for contact purposes | |
firstName | String | Yes | Returns the value of first_name field in the address | |
lastName | String | Yes | Last name of the person | |
company | String | Yes | Company name associated with this address | |
companyId | String | Yes | Business ID of the company | |
vatNumber | String | Yes | VAT identification number | |
vatId | String | Yes | VAT identification number | |
phone | String | Yes | Returns the value of phone field in the address | |
address1 | String | Yes | Returns the value of address1 field in the address | |
address2 | String | Yes | Returns the value of address2 field in the address | |
zipcode | String | Yes | Returns the value of zipcode field in the address | |
city | String | Yes | Returns the value of city field in the address | |
stateCode | String | Yes | Returns the value of state_code field in the address | |
countryCode | String | Yes | Returns the value of country_code field in the address | |
info | String | Yes | Additional information or notes for the address | |
latitude | String | Yes | Latitude coordinate of the address | |
longitude | String | Yes | Longitude coordinate of the address |
Relationships
The Address
type is used as a nested object within several other types, representing physical or shipping addresses related to those entities:
- CartShippingMethod.pickupAddress: Represents the pickup address for a shipping method in a cart.
- Cart.shippingAddress: The shipping address associated with a cart.
- Cart.billingAddress: The billing address associated with a cart.
- Customer.address: Addresses associated with a customer.
- Merchant.address: Addresses associated with a merchant.
These relationships allow traversal from higher-level objects like Cart
or Customer
down to detailed address information.
Usage Examples
Basic Query
Fetch basic address details including name, email, and city:
{
address {
name
email
city
}
}
Field Selection
Retrieve a comprehensive set of address fields for detailed display:
{
address {
firstName
lastName
company
address1
address2
city
stateCode
zipcode
countryCode
phone
}
}
Nested Queries
Query a cart’s shipping address nested within the cart object:
{
cart(id: 98765) {
shippingAddress {
firstName
lastName
address1
city
countryCode
phone
}
}
}
Filtering and Sorting
Since Address
is a nested object type and does not support direct filtering or sorting, these operations should be performed on the parent objects (e.g., filtering customers by city). Example filtering customers by city (assuming Customer
supports it):
{
customers(filter: {address: {city: "San Francisco"}}) {
edges {
node {
id
address {
city
firstName
lastName
}
}
}
}
}
Implements
The Address
type does not implement any interfaces.
Connections
The Address
type itself does not have connection fields but is commonly nested within connection objects such as Customer.address
or Cart.shippingAddress
.
Related Types
- Cart: Contains
shippingAddress
andbillingAddress
fields of typeAddress
. - Customer: Contains an
address
field of typeAddress
. - Merchant: Contains an
address
field of typeAddress
. - CartShippingMethod: Contains a
pickupAddress
field of typeAddress
.
Best Practices
- When querying addresses, select only the fields you need to optimize response size and performance.
- Use nested queries to retrieve address data in the context of related objects like carts or customers.
- Since all fields are optional, always implement null checks in your client application to handle missing data gracefully.
- Avoid over-fetching address data if only partial information is required, especially for large lists.
Notes
- All fields in the
Address
type are optional and may returnnull
if no data is available. - The API currently requires no authentication; however, this may change in future versions.
- Latitude and longitude fields are provided as strings and can be used for geolocation or mapping purposes.
- There are no computed or derived fields in this type.
- No field arguments are defined for the
Address
type fields. - Since
Address
is a nested object type, filtering, sorting, and pagination should be applied at the parent object level. - For performance, avoid requesting all address fields if only a subset is needed, especially in bulk queries.