younifyd
Menu

generateSessionSyncJwt

Generate a session-sync JWT that carries the customer, cart and analytics session to another storefront or checkout, with the route to redirect to.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the generateSessionSyncJwt action (under Generate).
  3. Fill in the fields below, then reference the result from later steps as {{generatesessionsyncjwt.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 GenerateSessionSyncJwt($redirectTo: String!, $cartId: String, $paymentWalletData: PaymentWalletDataInput, $analytics: AnalyticsCommonEventInput) {
  generateSessionSyncJwt(
    redirectTo: $redirectTo
    cartId: $cartId
    paymentWalletData: $paymentWalletData
    analytics: $analytics
  ) {
    result {
      token
      url
    }
    errors {
      __typename
      ... on GenerateSessionSyncTokenCartNotFound {
        message
      }
    }
  }
}

Variables

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

redirectTostringrequired

The route where to redirect after generation of token

cartIdstring

The cartId for which token should be created.

paymentWalletDataobject

The payment wallet data.

initializationIdstring
providerOrderIdstring
providerIdstring
analyticsobject

The analytics data.

initiatorobject2 fields
requestobjectrequired5 fields
consentobject3 fields
json
{
  "redirectTo": "string",
  "cartId": "string",
  "paymentWalletData": {
    "initializationId": "string",
    "providerOrderId": "string",
    "providerId": "string"
  },
  "analytics": {
    "request": {
      "url": "string",
      "userAgent": "string",
      "refererUrl": "string",
      "ip": "string",
      "acceptLanguage": "string"
    },
    "initiator": {
      "visitId": "string",
      "visitorId": "string"
    },
    "consent": {
      "targeting": false,
      "analytics": false,
      "functional": false
    }
  }
}

Response

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

resultobject
tokenstring
urlstring
errorsarray<object>
messageobject

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