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
- Add a step and choose the BigCommerce Storefront connector.
- Pick the generateSessionSyncJwt action (under Generate).
- 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.
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.
{
"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}}.
Need more? See the BigCommerce Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?