Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

createEmbedSession

Start an embedded partner dashboard session. Load the returned url in an iframe once. Its start token works one time and expires with the session. ttlSeconds accepts 60 to 600 and defaults to 600. Needs embed:write.

POST /api/v1/embed/sessions

Requires embed:write. Keep the Bearer key on your server.

Send placement or programIds, or omit both for an unrestricted session. layout defaults to full whether or not you send a placement. New placement enrollments require an active program and share the session transaction.

SDK

ts
grizzlee.createEmbedSession(input: { partner: { externalId: string; } | { id: string; }; programIds?: string[] | undefined; locale?: "en" | "fr-CA" | "hy" | "ru" | undefined; layout?: "full" | "simple" | undefined; actions?: ("payout_details:write" | "profile:write")[] | undefined; ttlSeconds?: number | undefined; embedOrigin?: string | undefined; placement?: string | undefined; }): Promise<CreateEmbedSessionResponse>

HTTP

Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.

sh
curl --fail-with-body --request POST \
  'https://app.grizzlee.ca/api/v1/embed/sessions' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"partner":{"externalId":"merchant-partner-001"}}'

Request body

FieldTypeRequiredDetails
partnerunionYes
locale"en", "fr-CA", "hy", "ru"No
layout"full", "simple"Nodefault "full"
actionsarrayNodefault []
ttlSecondsintegerNominimum 60. maximum 600. default 600
embedOriginstringNouri
placementstringNo
programIdsarrayNo

partner

Variant 1

FieldTypeRequiredDetails
partner.externalIdstringYes

Variant 2

FieldTypeRequiredDetails
partner.idstringYes

Request schema

json
{
  "type": "object",
  "properties": {
    "partner": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "externalId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          "required": [
            "externalId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        }
      ]
    },
    "locale": {
      "type": "string",
      "enum": [
        "en",
        "fr-CA",
        "hy",
        "ru"
      ]
    },
    "layout": {
      "type": "string",
      "enum": [
        "full",
        "simple"
      ],
      "default": "full"
    },
    "actions": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "payout_details:write",
          "profile:write"
        ]
      },
      "maxItems": 2,
      "default": []
    },
    "ttlSeconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 600,
      "default": 600
    },
    "embedOrigin": {
      "type": "string",
      "format": "uri"
    },
    "placement": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{1,62}$"
    },
    "programIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120
      },
      "minItems": 1
    }
  },
  "required": [
    "partner"
  ],
  "additionalProperties": false
}

Response

HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.

FieldTypeRequiredDetails
urlstringYesLoad this URL in the iframe once. The start token is in the fragment and works one time.
idstringYes
partnerIdstringYes
partnerExternalIdstringYes
programIdsunionYesNull includes all programs. Otherwise only these memberships are visible.
placementunionYes
localeunionYes
layoutunionYes
actionsarrayYes
embedOriginunionYesThe parent page origin the merchant expects, or null when the session allows any listed origin.
expiresAtstringYes
createdAtstringYes
consumedAtunionYesWhen the frame exchanged the start token.
revokedAtunionYes

programIds

Variant 1

Type: null.

Variant 2

Type: array.

placement

Variant 1

Type: null.

Variant 2

Type: string.

locale

Variant 1

Type: string.

Variant 2

Type: string.

Variant 3

Type: string.

Variant 4

Type: string.

layout

Variant 1

Type: string.

Variant 2

Type: string.

actions[]

Variant 1

Type: string.

Variant 2

Type: string.

embedOrigin

Variant 1

Type: null.

Variant 2

Type: string.

consumedAt

Variant 1

Type: null.

Variant 2

Type: string.

revokedAt

Variant 1

Type: null.

Variant 2

Type: string.

Response schema

json
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "Load this URL in the iframe once. The start token is in the fragment and works one time."
    },
    "id": {
      "type": "string"
    },
    "partnerId": {
      "type": "string"
    },
    "partnerExternalId": {
      "type": "string"
    },
    "programIds": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Null includes all programs. Otherwise only these memberships are visible."
    },
    "placement": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "locale": {
      "anyOf": [
        {
          "type": "string",
          "const": "en"
        },
        {
          "type": "string",
          "const": "fr-CA"
        },
        {
          "type": "string",
          "const": "hy"
        },
        {
          "type": "string",
          "const": "ru"
        }
      ]
    },
    "layout": {
      "anyOf": [
        {
          "type": "string",
          "const": "full"
        },
        {
          "type": "string",
          "const": "simple"
        }
      ]
    },
    "actions": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string",
            "const": "payout_details:write"
          },
          {
            "type": "string",
            "const": "profile:write"
          }
        ]
      }
    },
    "embedOrigin": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "description": "The parent page origin the merchant expects, or null when the session allows any listed origin."
    },
    "expiresAt": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "consumedAt": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ],
      "description": "When the frame exchanged the start token."
    },
    "revokedAt": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "required": [
    "url",
    "id",
    "partnerId",
    "partnerExternalId",
    "programIds",
    "placement",
    "locale",
    "layout",
    "actions",
    "embedOrigin",
    "expiresAt",
    "createdAt",
    "consumedAt",
    "revokedAt"
  ]
}

Errors

Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.