younifyd
Menu

validateSessionSyncJwt

Validate a session-sync JWT and restore the customer, cart and analytics session it carries.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the validateSessionSyncJwt action (under Validate).
  3. Fill in the fields below, then reference the result from later steps as {{validatesessionsyncjwt.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.

graphql
mutation ValidateSessionSyncJwt($jwt: String!) {
  validateSessionSyncJwt(jwt: $jwt) {
    content {
      customer {
        entityId
        company
        customerGroupId
        customerGroupName
        email
        firstName
        lastName
        notes
        phone
        taxExemptCategory
        addressCount
        attributeCount
        isSubscribedToNewsletter
        notificationPreferences
      }
      customerAccessToken {
        value
        expiresAt
      }
      cart {
        id
        entityId
        currencyCode
        displayCurrencyCode
        isTaxIncluded
        locale
        version
        externalSource
        source
        companyId
      }
      analytics {
        visitorId
        visitId
      }
      redirectTo
    }
    errors {
      __typename
      ... on InvalidSessionSyncJwtError {
        errorType
        message
      }
      ... on JwtTokenExpiredError {
        message
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

jwtstringrequired

jwt token session state with encoded session state.

json
{
  "jwt": "string"
}

Response

Read the result with {{validatesessionsyncjwt.response.data.data.validateSessionSyncJwt}}. If the API returns errors, the step fails and they are at {{validatesessionsyncjwt.response.data.errors}}.

contentobject
customerobject18 fields
customerAccessTokenobject2 fields
cartobject20 fields
analyticsobject5 fields
redirectTostring
errorsarray<object>
errorTypeobject
messageobject

Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.

Was this page helpful?