Setup

GET /setup

Get the onboarding checklist: connect your store, set your branding, send review requests, set up a loyalty program, set up wishlists and install the widgets. Each step is done when the organization's own records show it (a connected store or a catalog, a site logo, the review request automation switched on, a loyalty program, a saved wishlist, a storefront that has loaded a widget) or when it was marked done. It also answers the signals those checks read, whether the checklist was hidden, the publishable key and widget URLs an install needs, and what Meisei learned by reading the first site's storefront, less the saved product page, which GET /setup/site-preview answers.

Requires the settings:read permission.

Request
curl \
  "https://your-store.meisei.app/api/setup" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "signals": {
    "hasSite": true,
    "hasPublishableKey": true,
    "hasIntegration": true,
    "hasProducts": true,
    "hasBrandLogo": true,
    "sendsReviewRequests": true,
    "hasReview": true,
    "hasLoyaltyProgram": true,
    "loyaltyProgramOnSite": true,
    "hasWishlist": true,
    "widgetsSeen": true
  },
  "steps": {
    "connectStore": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "branding": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "reviewRequests": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "loyalty": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "wishlists": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "widgets": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    }
  },
  "guideDismissedAt": "2025-01-15T09:30:00Z",
  "widgetRequestHostname": "string",
  "publishableKey": "string",
  "embedScriptUrl": "string",
  "apiBaseUrl": "string",
  "siteAnalysis": {
    "hostname": "string",
    "status": "pending",
    "platform": "shopify",
    "brand": {
      "siteName": "string",
      "logoUrl": "string",
      "fonts": {
        "heading": "...",
        "body": "..."
      },
      "theme": "..."
    },
    "productPageUrl": "string",
    "pageKind": "product",
    "insertionPoints": {
      "rating": {
        "selector": "...",
        "position": "..."
      },
      "reviews": {
        "selector": "...",
        "position": "..."
      },
      "addToWishlist": {
        "selector": "...",
        "position": "..."
      },
      "wishlistNav": {
        "selector": "...",
        "position": "..."
      }
    },
    "error": "string",
    "requestedAt": "string",
    "finishedAt": "string"
  },
  "siteAnalysisHostname": "string",
  "siteAnalysisApplied": true,
  "shopifyAppStoreUrl": "string"
}

PATCH /setup

Mark onboarding steps done or uncheck them, and hide or show the checklist. Only what is sent changes. A step the organization's records already show as done stays done when it is unchecked, because nothing was marked to clear.

Requires the settings:write permission.

Body parameters

stepsobject

Steps to mark done or to uncheck. A step the records already show as done stays done whatever is sent.

dismissedboolean

True hides the checklist, false brings it back. The steps are kept either way.

Request
curl \
  -X PATCH \
  "https://your-store.meisei.app/api/setup" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "steps": {
    "connectStore": true,
    "branding": true,
    "reviewRequests": true,
    "loyalty": true,
    "wishlists": true,
    "widgets": true
  },
  "dismissed": true
}'
Response
{
  "signals": {
    "hasSite": true,
    "hasPublishableKey": true,
    "hasIntegration": true,
    "hasProducts": true,
    "hasBrandLogo": true,
    "sendsReviewRequests": true,
    "hasReview": true,
    "hasLoyaltyProgram": true,
    "loyaltyProgramOnSite": true,
    "hasWishlist": true,
    "widgetsSeen": true
  },
  "steps": {
    "connectStore": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "branding": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "reviewRequests": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "loyalty": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "wishlists": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    },
    "widgets": {
      "completedAt": "2025-01-15T09:30:00Z",
      "detected": true,
      "done": true
    }
  },
  "guideDismissedAt": "2025-01-15T09:30:00Z",
  "widgetRequestHostname": "string",
  "publishableKey": "string",
  "embedScriptUrl": "string",
  "apiBaseUrl": "string",
  "siteAnalysis": {
    "hostname": "string",
    "status": "pending",
    "platform": "shopify",
    "brand": {
      "siteName": "string",
      "logoUrl": "string",
      "fonts": {
        "heading": "...",
        "body": "..."
      },
      "theme": "..."
    },
    "productPageUrl": "string",
    "pageKind": "product",
    "insertionPoints": {
      "rating": {
        "selector": "...",
        "position": "..."
      },
      "reviews": {
        "selector": "...",
        "position": "..."
      },
      "addToWishlist": {
        "selector": "...",
        "position": "..."
      },
      "wishlistNav": {
        "selector": "...",
        "position": "..."
      }
    },
    "error": "string",
    "requestedAt": "string",
    "finishedAt": "string"
  },
  "siteAnalysisHostname": "string",
  "siteAnalysisApplied": true,
  "shopifyAppStoreUrl": "string"
}

GET /setup/site-preview

Get the product page Meisei saved from the first site's storefront, with the places the widgets could go on it, so the widgets can be previewed on the store's own page. It is a 404 when there is no site, when the store has not been read, or when the read is still running or found no product page.

Requires the settings:read permission.

Request
curl \
  "https://your-store.meisei.app/api/setup/site-preview" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "hostname": "string",
  "productPageUrl": "string",
  "pageKind": "product",
  "html": "string",
  "insertionPoints": {
    "rating": {
      "selector": "string",
      "position": "before"
    },
    "reviews": {
      "selector": "string",
      "position": "before"
    },
    "addToWishlist": {
      "selector": "string",
      "position": "before"
    },
    "wishlistNav": {
      "selector": "string",
      "position": "before"
    }
  }
}

POST /setup/apply-site-analysis

Copy what Meisei learned from the first site's storefront onto your records. The store's colors, font and corner radius become the site's widget appearance, but only while that appearance is untouched: anything you have already changed is left alone. With rename, the site and the organization also take the store's own name. It applies once per storefront address: after the first call for that address, calling it again changes nothing, even if you have since reset the appearance, and GET /setup reports siteAnalysisApplied.

Requires the settings:write permission.

Body parameters

renameboolean

Whether to rename the first site and the organization to the store's own name, when it could be read. Leave it off once the organization has a name somebody chose.

Request
curl \
  -X POST \
  "https://your-store.meisei.app/api/setup/apply-site-analysis" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "rename": false
}'
Response
{
  "data": {
    "signals": {
      "hasSite": true,
      "hasPublishableKey": true,
      "hasIntegration": true,
      "hasProducts": true,
      "hasBrandLogo": true,
      "sendsReviewRequests": true,
      "hasReview": true,
      "hasLoyaltyProgram": true,
      "loyaltyProgramOnSite": true,
      "hasWishlist": true,
      "widgetsSeen": true
    },
    "steps": {
      "connectStore": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "branding": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "reviewRequests": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "loyalty": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "wishlists": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "widgets": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      }
    },
    "guideDismissedAt": "2025-01-15T09:30:00Z",
    "widgetRequestHostname": "string",
    "publishableKey": "string",
    "embedScriptUrl": "string",
    "apiBaseUrl": "string",
    "siteAnalysis": {
      "hostname": "string",
      "status": "pending",
      "platform": "shopify",
      "brand": {
        "siteName": "...",
        "logoUrl": "...",
        "fonts": "...",
        "theme": "..."
      },
      "productPageUrl": "string",
      "pageKind": "product",
      "insertionPoints": {
        "rating": "...",
        "reviews": "...",
        "addToWishlist": "...",
        "wishlistNav": "..."
      },
      "error": "string",
      "requestedAt": "string",
      "finishedAt": "string"
    },
    "siteAnalysisHostname": "string",
    "siteAnalysisApplied": true,
    "shopifyAppStoreUrl": "string"
  },
  "themeApplied": true,
  "renamed": true
}

POST /setup/loyalty

Set a loyalty program up from a handful of answers. Every answer writes a working example rather than only turning a section on: points bring an earning rule, a welcome bonus and one redemption, and offers bring an offer. The program is attached to every site you have, and is created as a draft, so publish it when you are ready for shoppers to see it. Members are enrolled the first time they do something the program rewards.

Requires the settings:write permission.

Body parameters

pointsbooleanrequired

Whether the program runs on points. With points off members still get offers, and nothing accrues a balance.

pointsPerDollarnumber

How many points a whole unit of order value earns. Ignored when points are off.

offersbooleanrequired

Whether members can claim offers. Turning this on shows the offers section and creates one offer to start from.

Request
curl \
  -X POST \
  "https://your-store.meisei.app/api/setup/loyalty" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "points": true,
  "pointsPerDollar": 1,
  "offers": true
}'
Response
{
  "data": {
    "signals": {
      "hasSite": true,
      "hasPublishableKey": true,
      "hasIntegration": true,
      "hasProducts": true,
      "hasBrandLogo": true,
      "sendsReviewRequests": true,
      "hasReview": true,
      "hasLoyaltyProgram": true,
      "loyaltyProgramOnSite": true,
      "hasWishlist": true,
      "widgetsSeen": true
    },
    "steps": {
      "connectStore": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "branding": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "reviewRequests": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "loyalty": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "wishlists": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      },
      "widgets": {
        "completedAt": "...",
        "detected": "...",
        "done": "..."
      }
    },
    "guideDismissedAt": "2025-01-15T09:30:00Z",
    "widgetRequestHostname": "string",
    "publishableKey": "string",
    "embedScriptUrl": "string",
    "apiBaseUrl": "string",
    "siteAnalysis": {
      "hostname": "string",
      "status": "pending",
      "platform": "shopify",
      "brand": {
        "siteName": "...",
        "logoUrl": "...",
        "fonts": "...",
        "theme": "..."
      },
      "productPageUrl": "string",
      "pageKind": "product",
      "insertionPoints": {
        "rating": "...",
        "reviews": "...",
        "addToWishlist": "...",
        "wishlistNav": "..."
      },
      "error": "string",
      "requestedAt": "string",
      "finishedAt": "string"
    },
    "siteAnalysisHostname": "string",
    "siteAnalysisApplied": true,
    "shopifyAppStoreUrl": "string"
  },
  "program": {
    "id": "A4Ws1igz",
    "name": "string",
    "autoMembership": "off",
    "settings": {
      "previousPointsNames": null
    },
    "sectionsEnabled": {
      "rules": true,
      "offers": true
    },
    "pointsNames": {
      "singular": "string",
      "plural": "string"
    },
    "pointsExpiresAfterDays": 0,
    "pointsBalancesExpireAt": "2025-01-15T09:30:00Z",
    "rewardsExpireAfterDays": 0,
    "expiringSoonDays": 0,
    "pausedAt": "2025-01-15T09:30:00Z",
    "publishedAt": "2025-01-15T09:30:00Z",
    "createdAt": "2025-01-15T09:30:00Z",
    "updatedAt": "2025-01-15T09:30:00Z"
  },
  "rules": [
    {
      "id": "A4Ws1igz",
      "loyaltyProgramId": "A4Ws1igz",
      "section": "rules",
      "name": "string",
      "trigger": {
        "type": "..."
      },
      "reward": {
        "type": "...",
        "amount": "..."
      },
      "maxRedemptionsPerCustomer": 0,
      "maxAvailableCount": 0,
      "availableCount": 0,
      "availableFrom": "2025-01-15T09:30:00Z",
      "availableTo": "2025-01-15T09:30:00Z",
      "filter": "...",
      "metadata": "...",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "sites": [
    {
      "id": "A4Ws1igz",
      "siteId": "A4Ws1igz",
      "siteName": "string",
      "siteSlug": "string",
      "loyaltyProgramId": "A4Ws1igz",
      "programUrl": "string",
      "createdAt": "2025-01-15T09:30:00Z"
    }
  ]
}