Menu
login
Sign a customer in with email and password; returns the customer, their cart and (server-side only) a customer access token.
Use it in a workflow
- Add a step and choose the BigCommerce Storefront connector.
- Pick the login action (under Login).
- Fill in the fields below, then reference the result from later steps as
{{login.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation Login($email: String!, $password: String!, $guestCartEntityId: String) {
login(email: $email, password: $password, guestCartEntityId: $guestCartEntityId) {
result
customer {
entityId
company
customerGroupId
customerGroupName
email
firstName
lastName
notes
phone
taxExemptCategory
addressCount
attributeCount
storeCredit {
currencyCode
value
formatted
formattedV2
}
attributes {
__typename
}
formFields {
entityId
name
}
activeCompany {
companyName
}
isSubscribedToNewsletter
notificationPreferences
}
cart {
id
entityId
currencyCode
displayCurrencyCode
isTaxIncluded
baseAmount {
currencyCode
value
formatted
formattedV2
}
baseAmountInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
discountedAmount {
currencyCode
value
formatted
formattedV2
}
discountedAmountInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
amount {
currencyCode
value
formatted
formattedV2
}
amountInDisplayCurrency {
currencyCode
value
formatted
formattedV2
}
discounts {
entityId
displayName
}
lineItems {
totalQuantity
}
createdAt {
utc
}
updatedAt {
utc
}
locale
version
externalSource
source
companyId
}
customerAccessToken {
value
expiresAt
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"email": "string",
"password": "string",
"guestCartEntityId": "string"
}
Response
Read the result with {{login.response.data.data.login}}. If the API returns errors, the step fails and they are at {{login.response.data.errors}}.
Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?