MobiariDocs

Quickstart

From zero to your first authenticated API call in under five minutes.

By the end of this page you'll have a store API key and a list of your products from curl. You need curl and jq.

1. Open the admin

Sign in at app.mobiari.com and switch into the store you want to script against. The store name is at the top of the sidebar.

Building an integration? Start in your organization's test store: nothing it does reaches real customers, money or partners. Open it from Access → Service accounts → Open the test store, then follow the steps below there. See Test mode.

2. Create a store API key

A store API key belongs to a service account: a non-human member of the store that holds permission sets like a person does. Open Access in the sidebar, then the Service accounts tab, and click New service account:

  • Name: anything you'll recognize later. laptop curl is fine.
  • Permission sets: only what you need. For this walkthrough, a set that grants products.read is enough.

Then open the account's Keys and click New key. Name it after the place it will live. The raw key is shown exactly once:

mobi_sa_8aF3K2…NvWp

Copy it now

Mobiari stores only a hash of the key. If you close the dialog without copying it, revoke the key and create a new one.

export MOBIARI_KEY="mobi_sa_8aF3K2…NvWp"

3. Make your first call

The key works only for its store, so there is no store in the URL:

curl -s "https://api.mobiari.com/v1/products?limit=5" \
  -H "Authorization: Bearer $MOBIARI_KEY" \
  | jq '.data[].title'

From TypeScript, with the SDK (npm install @mobiari/api):

import { Mobiari } from '@mobiari/api'

const mobiari = new Mobiari({ apiKey: process.env.MOBIARI_KEY! })
const page = await mobiari.listProducts({ limit: 5 })
console.log(page.data.map((p) => p.title))

This prints the titles of your first five products. Lists come back as a Page: the items in data, plus has_more and next_cursor to get the next page. See Pagination.

If the service account lacks products.read, you get a 403 instead, with the code forbidden or missing_permission. Go back to Service accounts and give the account a permission set that grants it.

Calling with a session token

A store API key names its store. With any other credential, such as a person's session token, send the store's id in the Mobiari-Store header. Without a store the API answers 400 store_required.

4. Next steps

On this page