Schema Documentation

customer

Description

A customer object

Response

Returns a Customer

Arguments
NameDescription
id - ID Get the customer by their global ID
customerId - Int Get the customer by their database ID

Example

Query
query customer(
  $id: ID,
  $customerId: Int
){
  customer(
    id: $id,
    customerId: $customerId
  ){
    billing {
      ...CustomerAddressFragment
    }calculatedShippingdatabaseIddatedisplayNamedownloadableItems {
      ...CustomerToDownloadableItemConnectionFragment
    }emailfirstNamehasCalculatedShippingidisPayingCustomerisVatExemptlastNamelastOrder {
      ...OrderFragment
    }metaData {
      ...MetaDataFragment
    }modifiedorderCountorders {
      ...CustomerToOrderConnectionFragment
    }refunds {
      ...CustomerToRefundConnectionFragment
    }rolesessionTokenshipping {
      ...CustomerAddressFragment
    }totalSpentusername
  }
}
Variables
{"id":"4","customerId":123}
Response
{"data":{"customer":{"billing":CustomerAddress,"calculatedShipping":true,"databaseId":123,"date":"abc123","displayName":"abc123","downloadableItems":CustomerToDownloadableItemConnection,"email":"abc123","firstName":"xyz789","hasCalculatedShipping":false,"id":"4","isPayingCustomer":false,"isVatExempt":true,"lastName":"xyz789","lastOrder":Order,"metaData":[MetaData],"modified":"abc123","orderCount":987,"orders":CustomerToOrderConnection,"refunds":CustomerToRefundConnection,"role":"abc123","sessionToken":"xyz789","shipping":CustomerAddress,"totalSpent":123.45,"username":"xyz789"}}}