Supermatic Docs

@supermatic/shopify/customer

get

Get a customer.

get(
  storeName: string, // The name of your store.
  id: string // The global ID of the customer.
): Promise<{
  acceptsMarketing: boolean;
  acceptsMarketingUpdatedAt: string;
  addresses: {
    address1: string;
    address2: string;
    city: string;
    company: string;
    country: string;
    countryCode: string;
    firstName: string;
    id: string;
    lastName: string;
    latitude: string;
    longitude: string;
    name: string;
    phone: string;
    province: string;
    provinceCode: string;
    zip: string;
  };
  averageOrderAmount: {
    amount: string;
    currencyCode: string;
  };
  canDelete: boolean;
  createdAt: string;
  defaultAddress: {
    address1: string;
    address2: string;
    city: string;
    company: string;
    country: string;
    countryCode: string;
    firstName: string;
    id: string;
    lastName: string;
    latitude: string;
    longitude: string;
    name: string;
    phone: string;
    province: string;
    provinceCode: string;
    zip: string;
  };
  displayName: string;
  email: string;
  firstName: string;
  hasNote: boolean;
  hasTimelineComment: string;
  id: string;
  lastName: string;
  legacyResourceId: number;
  lifetimeDuration: string;
  locale: string;
  marketingOptInLevel: string;
  multipassIdentifier: string;
  note: string;
  ordersCount: number;
  phone: string;
  productSubscriberStatus: string;
  state: string;
  tags: string[];
  taxExempt: boolean;
  taxExemptions: string[];
  totalSpent: {
    amount: string;
    currencyCode: string;
  };
  updatedAt: string;
  validEmailAddress: boolean;
  verifiedEmail: boolean;
}>

Example

import customer from "@supermatic/shopify/customer";

await customer.get("examplestore", "gid://shopify/Customer/123");