Skip to Content

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

FieldTypeNullableDescriptionRelated Type
nameStringYesFull name of the person associated with this address
emailStringYesEmail address for contact purposes
firstNameStringYesReturns the value of first_name field in the address
lastNameStringYesLast name of the person
companyStringYesCompany name associated with this address
companyIdStringYesBusiness ID of the company
vatNumberStringYesVAT identification number
vatIdStringYesVAT identification number
phoneStringYesReturns the value of phone field in the address
address1StringYesReturns the value of address1 field in the address
address2StringYesReturns the value of address2 field in the address
zipcodeStringYesReturns the value of zipcode field in the address
cityStringYesReturns the value of city field in the address
stateCodeStringYesReturns the value of state_code field in the address
countryCodeStringYesReturns the value of country_code field in the address
infoStringYesAdditional information or notes for the address
latitudeStringYesLatitude coordinate of the address
longitudeStringYesLongitude 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.

  • Cart: Contains shippingAddress and billingAddress fields of type Address.
  • Customer: Contains an address field of type Address.
  • Merchant: Contains an address field of type Address.
  • CartShippingMethod: Contains a pickupAddress field of type Address.

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 return null 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.
Last updated on