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

# Write the plain-language conclusion of an A/B test

> Asks the model to explain the test's result from its metrics (abTestMetrics) and stores the text on the test's Shopify metaobject. If `metaobject.generated_conclusion` is already non-empty it is returned unchanged: no model call, no write. Otherwise it costs a model call and writes to Shopify.



## OpenAPI

````yaml /api-reference/openapi/lite.json put /ab-test/generate_conclusion
openapi: 3.1.0
info:
  title: Search & Merchandising API
  version: 1.0.0
  description: >-
    REST API behind Depict: Search & Merchandising, the native Shopify app:
    onboarding, collections, boost & bury, dashboards, A/B testing and
    multi-store management. Endpoints are served under the /api/lite prefix and
    are authenticated with the Shopify session token that App Bridge issues to
    the embedded app.
servers:
  - url: /api/lite
security:
  - ShopifySessionToken: []
paths:
  /ab-test/generate_conclusion:
    put:
      summary: Write the plain-language conclusion of an A/B test
      description: >-
        Asks the model to explain the test's result from its metrics
        (abTestMetrics) and stores the text on the test's Shopify metaobject. If
        `metaobject.generated_conclusion` is already non-empty it is returned
        unchanged: no model call, no write. Otherwise it costs a model call and
        writes to Shopify.
      operationId: abTestGenerateConclusion
      parameters:
        - schema:
            type: string
            description: Lite merchant id, e.g. `shopify-<shop id>`.
          required: true
          description: Lite merchant id, e.g. `shopify-<shop id>`.
          name: merchant_id
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateConclusionRequest'
      responses:
        '200':
          description: The conclusion text; null when the model returned none.
          content:
            application/json:
              schema:
                type:
                  - string
                  - 'null'
        '400':
          description: >-
            The query or body failed the schema, or the merchant's Shopify
            config is missing; `detail` says which.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: Merchant not found for this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '415':
          description: Content-Type is not application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    GenerateConclusionRequest:
      type: object
      properties:
        metaobject:
          $ref: '#/components/schemas/ProAbTest'
        data:
          $ref: '#/components/schemas/AbTestMetrics'
      required:
        - metaobject
        - data
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    ProAbTest:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            The test's Shopify metaobject GID. Required unless
            generated_conclusion is set: a generation without it answers 500 and
            writes nothing.
        handle:
          type: string
        start_date:
          type: string
        end_date:
          type: string
        experiment_name:
          type: string
        notify_email:
          type: string
        generated_conclusion:
          type:
            - string
            - 'null'
          description: A stored conclusion; when non-empty it is returned as-is.
      required:
        - handle
        - start_date
        - end_date
        - experiment_name
        - notify_email
    AbTestMetrics:
      type: object
      properties:
        page_views:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        clicks:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        click_thru_rate:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        p_value_click_thru_rate:
          type:
            - number
            - 'null'
          description: >-
            Two-proportion z-test p-value over the whole window; null when a
            variant has no traffic.
        add_to_carts:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        add_to_cart_thru_rate:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        p_value_add_to_cart_thru_rate:
          type:
            - number
            - 'null'
          description: >-
            Two-proportion z-test p-value over the whole window; null when a
            variant has no traffic.
        purchases:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        purchases_thru_rate:
          type: array
          items:
            $ref: '#/components/schemas/AbTimeseriesMetric'
        p_value_purchases_thru_rate:
          type:
            - number
            - 'null'
          description: >-
            Two-proportion z-test p-value over the whole window; null when a
            variant has no traffic.
      required:
        - page_views
        - clicks
        - click_thru_rate
        - p_value_click_thru_rate
        - add_to_carts
        - add_to_cart_thru_rate
        - p_value_add_to_cart_thru_rate
        - purchases
        - purchases_thru_rate
        - p_value_purchases_thru_rate
      description: Daily A/B series for one collection test, plus pooled z-tests.
    AbTimeseriesMetric:
      type: object
      properties:
        day:
          type: string
          description: YYYY-MM-DD
        metric_a:
          type: number
          description: Variant A (original).
        metric_b:
          type: number
          description: Variant B (Depict).
      required:
        - day
        - metric_a
        - metric_b
  securitySchemes:
    ShopifySessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Shopify App Bridge session token of the embedded Depict: Search &
        Merchandising app. The shop in the token determines the merchant;
        merchant_id parameters must belong to that shop.

````