For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
  • GraphQL
    • Overview
      • Playground
      • Explorer
          • MUTcreateCart
          • MUTdeleteCart
          • MUTaddCartLineItems
          • MUTupdateCartLineItem
          • MUTdeleteCartLineItem
          • MUTupdateCartCurrency
          • MUTassignCartToCustomer
          • MUTunassignCartFromCustomer
          • MUTcreateCartMetafield
          • MUTupdateCartMetafield
          • MUTdeleteCartMetafield
          • MUTcreateCartRedirectUrls
          • MUTcreateCheckout
          • MUTupdateCheckout
          • MUTaddCheckoutBillingAddress
          • MUTupdateCheckoutBillingAddress
          • MUTupdateCheckoutCustomerMessage
          • MUTselectCheckoutShippingOption
          • MUTapplyCheckoutCoupon
          • MUTunapplyCheckoutCoupon
          • MUTapplyCheckoutGiftCertificate
          • MUTunapplyCheckoutGiftCertificate
          • MUTapplyCheckoutSpamProtection
          • MUTaddCheckoutShippingConsignments
          • MUTupdateCheckoutShippingConsignment
          • MUTdeleteCheckoutConsignment
          • MUTcompleteCheckout
          • MUTlogin
          • MUTlogout
          • MUTcreateWishlist
          • MUTaddWishlistItems
          • MUTdeleteWishlistItems
          • MUTupdateWishlist
          • MUTdeleteWishlists
          • MUTloginWithCustomerLoginJwt
          • MUTsubmitContactUs
          • MUTgenerateSessionSyncJwt
          • MUTvalidateSessionSyncJwt
          • MUTproductViewedEvent
          • MUTpageViewedEvent
          • MUTvisitStartedEvent
          • MUTsearchProductEvent
          • MUTpreviewGiftCertificate
          • MUTregisterCompany
          • MUTaddProductReview
          • MUTchangePassword
          • MUTrequestResetPassword
          • MUTresetPassword
          • MUTregisterCustomer
          • MUTupdateCustomer
          • MUTaddCustomerAddress
          • MUTupdateCustomerAddress
          • MUTdeleteCustomerAddress
          • MUTpayment
          • MUTsubscribe
          • MUTunsubscribe
  • MCP
    • Overview
Dev Portal
LogoLogo
GraphQLStorefrontMutations

login

Example Query
1mutation ExampleMutation($email: String, $password: String, $guestCartEntityId: String) {
2 login(email: $email, password: $password, guestCartEntityId: $guestCartEntityId) {
3 result
4 customer {
5 entityId
6 company
7 customerGroupId
8 customerGroupName
9 email
10 firstName
11 lastName
12 notes
13 phone
14 taxExemptCategory
15 }
16 cart {
17 id
18 entityId
19 currencyCode
20 displayCurrencyCode
21 isTaxIncluded
22 baseAmount
23 baseAmountInDisplayCurrency
24 discountedAmount
25 discountedAmountInDisplayCurrency
26 amount
27 }
28 customerAccessToken {
29 value
30 expiresAt
31 }
32 }
33}
Variables
1{
2 "email": "example",
3 "password": "example",
4 "guestCartEntityId": "example"
5}
Example response
1{
2 "data": {
3 "login": {
4 "result": "example",
5 "customer": {
6 "entityId": 0,
7 "company": "example",
8 "customerGroupId": 0,
9 "customerGroupName": "example",
10 "email": "example",
11 "firstName": "example",
12 "lastName": "example",
13 "notes": "example",
14 "phone": "example",
15 "taxExemptCategory": "example"
16 },
17 "cart": {
18 "id": "example",
19 "entityId": "example",
20 "currencyCode": "example",
21 "displayCurrencyCode": "example",
22 "isTaxIncluded": true,
23 "baseAmount": {
24 "currencyCode": null,
25 "value": null,
26 "formatted": null,
27 "formattedV2": null
28 },
29 "baseAmountInDisplayCurrency": {
30 "currencyCode": null,
31 "value": null,
32 "formatted": null,
33 "formattedV2": null
34 },
35 "discountedAmount": {
36 "currencyCode": null,
37 "value": null,
38 "formatted": null,
39 "formattedV2": null
40 },
41 "discountedAmountInDisplayCurrency": {
42 "currencyCode": null,
43 "value": null,
44 "formatted": null,
45 "formattedV2": null
46 },
47 "amount": {
48 "currencyCode": null,
49 "value": null,
50 "formatted": null,
51 "formattedV2": null
52 }
53 },
54 "customerAccessToken": {
55 "value": "example",
56 "expiresAt": "DateTime"
57 }
58 }
59 }
60}
Customer login.
Was this page helpful?
Previous

completeCheckout

Next

logout

Built with

Arguments

emailStringRequired
An email of the customer.
passwordStringRequired
A password of the customer.
guestCartEntityIdStringOptional
The guest cart entity ID which should be assigned to customer.

Returns

a LoginResult
resultString
The result of a login
customerCustomer
The currently logged in customer.
cartCart
The cart that is assigned to the customer after login.
customerAccessTokenCustomerAccessToken

The customer access token. This field can only be fetched in server-to-server context.