customer.graphql 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. # Represents the data about a staff member's Shopify account.
  2. # Merchants can use staff member data to get more information about the staff members in their store.
  3. type StaffMember implements Node {
  4. # Whether the staff member is active.
  5. active: Boolean!
  6. # The image used as the staff member's avatar in the Shopify admin.
  7. avatar(fallback: StaffMemberDefaultImage = DEFAULT): Image!
  8. # The staff member's email address.
  9. email: String!
  10. # Whether the staff member's account exists.
  11. exists: Boolean!
  12. # The staff member's first name.
  13. firstName: String
  14. # A globally-unique identifier.
  15. id: ID!
  16. # The staff member's initials, if available.
  17. initials: [String!]
  18. # Whether the staff member is the shop owner.
  19. isShopOwner: Boolean!
  20. # The staff member's last name.
  21. lastName: String
  22. # The staff member's preferred locale. Locale values use the format language or language-COUNTRY, where language is a two-letter language code, and COUNTRY is a two-letter country code. For example: en or en-US
  23. locale: String!
  24. # The staff member's full name.
  25. name: String!
  26. # The staff member's phone number.
  27. phone: String
  28. # The data used to customize the Shopify admin experience for the staff member.
  29. privateData: StaffMemberPrivateData!
  30. }
  31. # Represents the data used to customize the Shopify admin experience for a logged-in staff member.
  32. type StaffMemberPrivateData {
  33. # The URL to the staff member's account settings page.
  34. accountSettingsUrl: URL!
  35. # The date and time when the staff member was created.
  36. createdAt: DateTime!
  37. }
  38. # The record of when a customer consented to receive marketing material by email.
  39. type CustomerEmailMarketingConsentState {
  40. # The date and time at which the customer consented to receive marketing material by email.
  41. # The customer's consent state reflects the consent record with the most recent consent_updated_at date.
  42. # If no date is provided, then the date and time at which the consent information was sent is used.
  43. consentUpdatedAt: DateTime
  44. # The marketing subscription opt-in level, as described by the M3AAWG best practices guidelines,
  45. # that the customer gave when they consented to receive marketing material by email.
  46. marketingOptInLevel: CustomerMarketingOptInLevel
  47. # The current email marketing state for the customer.
  48. marketingState: CustomerEmailMarketingState!
  49. }
  50. # The record of when a customer consented to receive marketing material by SMS.
  51. #
  52. # The customer's consent state reflects the record with the most recent date when consent was updated.
  53. type CustomerSmsMarketingConsentState {
  54. # The source from which the SMS marketing information for the customer was collected.
  55. consentCollectedFrom: CustomerConsentCollectedFrom
  56. # The date and time when the customer consented to receive marketing material by SMS.
  57. # If no date is provided, then the date and time when the consent information was sent is used.
  58. consentUpdatedAt: DateTime
  59. # The marketing subscription opt-in level that was set when the customer consented to receive marketing information.
  60. marketingOptInLevel: CustomerMarketingOptInLevel!
  61. # The current SMS marketing state for the customer.
  62. marketingState: CustomerSmsMarketingState!
  63. }
  64. # A customer's computed statistics.
  65. type CustomerStatistics {
  66. # The predicted spend tier of a customer with a shop.
  67. predictedSpendTier: CustomerPredictedSpendTier
  68. }
  69. # Represents a customer's session visiting a shop's online store,
  70. # including information about the marketing activity attributed to starting the session.
  71. type CustomerVisit implements CustomerMoment&Node {
  72. # A globally-unique identifier.
  73. id: ID!
  74. # URL of the first page the customer landed on for the session.
  75. landingPage: URL
  76. # Landing page information with URL linked in HTML.
  77. # For example, the first page the customer visited was store.myshopify.com/products/1.
  78. landingPageHtml: HTML
  79. # Represent actions taken by an app, on behalf of a merchant,
  80. # to market Shopify resources such as products, collections, and discounts.
  81. marketingEvent: MarketingEvent
  82. # The date and time when the customer's session occurred.
  83. occurredAt: DateTime!
  84. # Marketing referral code from the link that the customer clicked to visit the store.
  85. # Supports the following URL attributes: ref, source, or r.
  86. # For example, if the URL is myshopifystore.com/products/slide?ref=j2tj1tn2, then this value is j2tj1tn2.
  87. referralCode: String
  88. # Referral information with URLs linked in HTML.
  89. referralInfoHtml: FormattedString!
  90. # Webpage where the customer clicked a link that sent them to the online store.
  91. # For example, https://randomblog.com/page1 or android-app://com.google.android.gm.
  92. referrerUrl: URL
  93. # Source from which the customer visited the store, such as a platform (Facebook, Google), email, direct,
  94. # a website domain, QR code, or unknown.
  95. source: String!
  96. # Describes the source explicitly for first or last session.
  97. sourceDescription: String
  98. # Type of marketing tactic.
  99. sourceType: MarketingTactic
  100. # A set of UTM parameters gathered from the URL parameters of the referrer.
  101. utmParameters: UTMParameters
  102. }
  103. # A customer's payment method.
  104. type CustomerPaymentMethod implements Node {
  105. # The customer to whom the payment method belongs.
  106. customer: Customer
  107. # The ID of this payment method.
  108. id: ID!
  109. # The instrument for this payment method.
  110. instrument: CustomerPaymentInstrument
  111. # The time that the payment method was revoked.
  112. revokedAt: DateTime
  113. # The revocation reason for this payment method.
  114. revokedReason: CustomerPaymentMethodRevocationReason
  115. # List Subscription Contracts.
  116. subscriptionContracts(
  117. first: Int
  118. after: String
  119. last: Int
  120. before: String
  121. reverse: Boolean = false
  122. ): SubscriptionContractConnection!
  123. }
  124. # Represents a customer's visiting activities on a shop's online store.
  125. type CustomerJourneySummary {
  126. customerOrderIndex: Int
  127. # The position of the current order within the customer's order history. Test orders aren't included.
  128. # The number of days between the first session and the order creation date.
  129. # The first session represents the first session since the last order, or the first session within the 30 day attribution window, if more than 30 days have passed since the last order.
  130. daysToConversion: Int
  131. # The customer's first session going into the shop.
  132. firstVisit: CustomerVisit
  133. # The last session before an order is made.
  134. lastVisit: CustomerVisit
  135. # The events preceding a customer's order, such as shop sessions.
  136. moments(
  137. first: Int
  138. after: String
  139. last: Int
  140. before: String
  141. reverse: Boolean = false
  142. ): CustomerMomentConnection
  143. # The total number of customer moments associated with this order. Returns null if the order is still in the process of being attributed.
  144. momentsCount: Int
  145. # Whether the attributed sessions for the order have been created yet.
  146. ready: Boolean!
  147. }
  148. # Represents a card instrument for customer payment method.
  149. type CustomerCreditCard {
  150. # The billing address of the card.
  151. billingAddress: CustomerCreditCardBillingAddress
  152. # The brand of the card.
  153. brand: String!
  154. # Whether the card is about to expire.
  155. expiresSoon: Boolean!
  156. # The expiry month of the card.
  157. expiryMonth: Int!
  158. # The expiry year of the card.
  159. expiryYear: Int!
  160. # The card's BIN number.
  161. firstDigits: String
  162. # The payment method can be revoked if there are no active subscription contracts.
  163. isRevocable: Boolean!
  164. # The last 4 digits of the card.
  165. lastDigits: String!
  166. # The masked card number with only the last 4 digits displayed.
  167. maskedNumber: String!
  168. # The name of the card holder.
  169. name: String!
  170. # The source of the card if coming from a wallet such as Apple Pay.
  171. source: String
  172. # The last 4 digits of the Device Account Number.
  173. virtualLastDigits: String
  174. }
  175. # The billing address of a credit card payment instrument.
  176. type CustomerCreditCardBillingAddress {
  177. # The first line of the address. Typically the street address or PO Box number.
  178. address1: String
  179. # The name of the city, district, village, or town.
  180. city: String
  181. # The name of the country.
  182. country: String
  183. # The two-letter code for the country of the address.
  184. # For example, US.
  185. countryCode: CountryCode
  186. # The region of the address, such as the province, state, or district.
  187. province: String
  188. # The two-letter code for the region.
  189. # For example, ON.
  190. provinceCode: String
  191. # The zip or postal code of the address.
  192. zip: String
  193. }
  194. # Represents a PayPal instrument for customer payment method.
  195. type CustomerPaypalBillingAgreement {
  196. # The billing address of this payment method.
  197. billingAddress: CustomerPaymentInstrumentBillingAddress
  198. # Whether the PayPal billing agreement is inactive.
  199. inactive: Boolean!
  200. # Whether the payment method can be revoked.The payment method can be revoked if there are no active subscription contracts.
  201. isRevocable: Boolean!
  202. # The customers's PayPal account email address.
  203. paypalAccountEmail: String
  204. }
  205. # The billing address of a payment instrument.
  206. type CustomerPaymentInstrumentBillingAddress {
  207. # The first line of the address. Typically the street address or PO Box number.
  208. address1: String
  209. # The name of the city, district, village, or town.
  210. city: String
  211. # The name of the country.
  212. country: String
  213. # The two-letter code for the country of the address.
  214. # For example, US.
  215. countryCode: CountryCode
  216. # The name of the buyer of the address.
  217. name: String
  218. # The region of the address, such as the province, state, or district.
  219. province: String
  220. # The two-letter code for the region.
  221. # For example, ON.
  222. provinceCode: String
  223. # The zip or postal code of the address.
  224. zip: String
  225. }
  226. # Represents a Shop Pay card instrument for customer payment method.
  227. type CustomerShopPayAgreement {
  228. # Whether the card is about to expire.
  229. expiresSoon: Boolean!
  230. # The expiry month of the card.
  231. expiryMonth: Int!
  232. # The expiry year of the card.
  233. expiryYear: Int!
  234. # Whether the Shop Pay billing agreement is inactive.
  235. inactive: Boolean!
  236. # The payment method can be revoked if there are no active subscription contracts.
  237. isRevocable: Boolean!
  238. # The last 4 digits of the card.
  239. lastDigits: String!
  240. # The masked card number with only the last 4 digits displayed.
  241. maskedNumber: String!
  242. # The name of the card holder.
  243. name: String!
  244. }
  245. # An auto-generated type for paginating through multiple CustomerMoments.
  246. type CustomerMomentConnection {
  247. # A list of edges.
  248. edges: [CustomerMomentEdge!]!
  249. # A list of the nodes contained in CustomerMomentEdge.
  250. nodes: [CustomerMoment!]!
  251. # Information to aid in pagination.
  252. pageInfo: PageInfo!
  253. }
  254. # An auto-generated type which holds one CustomerMoment and a cursor during pagination.
  255. type CustomerMomentEdge {
  256. # A cursor for use in pagination.
  257. cursor: String!
  258. # The item at the end of CustomerMomentEdge.
  259. node: CustomerMoment!
  260. }
  261. # An auto-generated type for paginating through multiple StaffMembers.
  262. type StaffMemberConnection {
  263. # A list of edges.
  264. edges: [StaffMemberEdge!]!
  265. # A list of the nodes contained in StaffMemberEdge.
  266. nodes: [StaffMember!]!
  267. # Information to aid in pagination.
  268. pageInfo: PageInfo!
  269. }
  270. # An auto-generated type which holds one StaffMember and a cursor during pagination.
  271. type StaffMemberEdge {
  272. # A cursor for use in pagination.
  273. cursor: String!
  274. # The item at the end of StaffMemberEdge.
  275. node: StaffMember!
  276. }