> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stella-commerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Zunkiree

> Provision a Zunkiree tenant for the authenticated merchant.

Soft-failure semantics per §1.5: `push_sync_credentials` or
`register_webhook` failing AFTER provision succeeded returns 201
with `*_pending: true` flags rather than 5xx + rollback. Recovery
is via `POST /rotate-sync-key`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/dashboard/integrations/zunkiree/connect
openapi: 3.1.0
info:
  title: Agentic Commerce API
  description: |2-

        Agentic Commerce API - E-commerce Backend

        ## APIs

        ### Dashboard API (`/api/dashboard`)
        Authenticated endpoints for merchant management:
        - Products, Variants, Options
        - Inventory management
        - Orders and fulfillment
        - Customers
        - Collections

        ### Storefront API (`/api/storefront`)
        Public endpoints for client websites:
        - Product catalog
        - Collections
        - Cart management
        - Checkout

        ### Sync API (`/api/sync`)
        Integration endpoints for zunkiree-search:
        - Product sync
        - Availability checks
        - Order creation from AI widget
        
  version: 1.0.0
servers: []
security: []
paths:
  /api/dashboard/integrations/zunkiree/connect:
    post:
      tags:
        - Dashboard
        - Integrations
      summary: Connect Zunkiree
      description: |-
        Provision a Zunkiree tenant for the authenticated merchant.

        Soft-failure semantics per §1.5: `push_sync_credentials` or
        `register_webhook` failing AFTER provision succeeded returns 201
        with `*_pending: true` flags rather than 5xx + rollback. Recovery
        is via `POST /rotate-sync-key`.
      operationId: connect_zunkiree_api_dashboard_integrations_zunkiree_connect_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: X-Stella-Merchant-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Stella-Merchant-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ConnectRequest:
      properties:
        brand_name:
          type: string
          maxLength: 120
          minLength: 1
          title: Brand Name
          description: Display name shown in the widget header.
        contact_email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Contact Email
          description: Where Zunkiree-side lead-capture emails should go.
        website_type:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Website Type
          description: >-
            e.g. 'ecommerce', 'saas', 'healthcare'. Hint for Z6's default widget
            tone selection.
        language:
          anyOf:
            - type: string
              maxLength: 8
            - type: 'null'
          title: Language
          description: BCP-47 language tag, e.g. 'en', 'th-TH'.
      type: object
      required:
        - brand_name
      title: ConnectRequest
      description: |-
        Body for `POST /api/dashboard/integrations/zunkiree/connect`.

        `brand_name` is the only required field — Z6's `/api/v1/admin/tenants`
        requires it (admin_tenants.py:74). Everything else is optional pass-
        through; Z6 fills sensible defaults when omitted.
    ConnectResponse:
      properties:
        status:
          type: string
          title: Status
          description: >-
            Always 'connected' on success; partial-state failures still return
            201 + the *_pending flags below.
          default: connected
        site_id:
          type: string
          title: Site Id
        widget_script:
          anyOf:
            - type: string
            - type: 'null'
          title: Widget Script
        connected_at:
          type: string
          format: date-time
          title: Connected At
        sync_key_pending:
          type: boolean
          title: Sync Key Pending
          default: false
        webhook_pending:
          type: boolean
          title: Webhook Pending
          default: false
      type: object
      required:
        - site_id
        - connected_at
      title: ConnectResponse
      description: |-
        Response from `POST /connect`.

        `sync_key_pending=true` iff `push_sync_credentials` failed after
        `provision_tenant` succeeded — the tenant exists on Z6 but Z6 doesn't
        know about Stella's sync key yet. Caller's recovery: hit
        `POST /rotate-sync-key`.

        `webhook_pending=true` iff the optional `register_webhook` call at
        the end of `/connect` failed — non-blocking; widget functions
        without the subscription. No user-facing recovery in v1; Stella's
        inbound-from-Zunkiree storage isn't built yet anyway (S8 docstring).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````