MobiariDocs

Products

Concepts, endpoints, and media model for managing your catalog.

A product in Mobiari is a sellable thing in your store. Every product has one or more variants. Even a "single" product has one variant under the hood, so pricing and stock are always carried on the variant, never on the product itself.

Mental model

product                         ← title, description, brand, status
├── variants[]                  ← sku, price_cents, fulfillment_mode, stock_quantity
│   ├── options[]               ← e.g. size=M, color=blue
│   └── stock_by_location[]     ← units at each location
├── option_groups[]             ← the product's options and their values
├── images[]                    ← gallery items (images and videos): url, thumbnail_url
└── video_url         ← one short video → bottom-left widget on PDP

A few terms that matter:

  • type: "single" (one variant), "variable" (several variants with options such as size and color) or "kit" (built from other products' variants).
  • status: draft, active or archived. Only active products are sold. New products are drafts unless you send a status.
  • fulfillment_mode on the variant: stocked, on_demand, or stocked_or_on_demand. Decides whether availability is computed from inventory or always treated as "in stock".
  • media_type on a gallery row: "image" (default) or "video". Image rows go through the resize pipeline; video rows skip it and point straight at the URL.

Product specs and reviews are not part of the public API yet.

Endpoints

All paths below are relative to https://api.mobiari.com/v1. There is no store in the path: a store API key (Authorization: Bearer mobi_sa_…) works only for its store. With any other credential, send the store's id in the Mobiari-Store header. The full list is in the API reference.

MethodPathPurpose
GET/productsList, paginated. See Listing.
POST/productsCreate. Returns the new product.
GET/products/{product_id}Single product with variants, option groups and gallery.
PATCH/products/{product_id}Update. Fields you leave out are left alone.
DELETE/products/{product_id}Delete, with its variants and gallery. Refused while an order references the product: archive it instead.
GET/products/{product_id}/variantsThe product's variants.
POST/products/{product_id}/variantsAdd a variant.
PATCH/variants/{variant_id}Update a variant (price, SKU, and so on), and its dimensions (weight and sides of one unit), shipping_profile and custom_fields.
GET/products/{product_id}/imagesThe gallery: each item with its url and, for an image, a thumbnail_url.
POST/products/{product_id}/imagesUpload an image (multipart).
PATCH/products/{product_id}/images/{image_id}Reorder, set primary, swap alt text.
DELETE/products/{product_id}/images/{image_id}Remove a gallery item.

Attaching a file that is already in the media library is not part of the public API yet.

Create a product

curl -X POST "https://api.mobiari.com/v1/products" \
  -H "Authorization: Bearer $MOBIARI_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "title": "Iced Matcha",
    "description": "Stone-ground ceremonial grade.",
    "type": "single",
    "default_price_cents": 1890
  }'

A single product gets its one variant created in the same request when you pass default_price_cents. For variable products, omit default_price_cents and create each variant with POST /products/{product_id}/variants, passing price_cents (required) and, if you want to choose them, sku and title. On a product with options, an active variant also names one value of each option in option_value_ids.

Send an Idempotency-Key on creates so a retried request can't create the product twice. See Idempotency.

Categories, channels and shipping

A product also carries where it is filed and sold, as fields you read with the product and write with PATCH /products/{product_id}. Create the product first (POST /products takes custom_fields and slug is made from the title), then set them:

FieldReadWrite
category_idsThe categories it is inThe full list: categories left out are removed
collection_idsThe collections it is inRead only: use PUT/DELETE /collections/{collection_id}/products/{product_id}
sales_channelsall, or the sales_channel_ids it is sold onSend both all and sales_channel_ids
shipping_profileHow it is packed for freightThe whole profile
slugIts storefront URL segmentA new one; the old URL keeps working as a redirect
custom_fieldsValues of the store's product fieldsThe keys you send; the others keep their value
specsIts specification values, by field_idThe entries you send; the others keep their value
curl -X PATCH "https://api.mobiari.com/v1/products/$PRODUCT_ID" \
  -H "Authorization: Bearer $MOBIARI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "category_ids": ["0199c0de-…"], "sales_channels": { "all": true, "sales_channel_ids": [] } }'

A field your key may not read (the shipping profile takes inventory.read) is left out of the answer; the product is answered all the same.

These fields are applied one after the other, and the product's own fields last: the answer, and the products.updated webhook, show the product with all of them. If one is refused, the answer names it (details.field), the product's own fields are not changed, and the ones before it stay applied. Every one of them sets a value, so sending the same request again finishes the change.

Upload an image

Send the file as multipart/form-data in the image field (JPEG, PNG or WebP, up to 10 MB):

curl -X POST "https://api.mobiari.com/v1/products/$PRODUCT_ID/images" \
  -H "Authorization: Bearer $MOBIARI_KEY" \
  -F "image=@matcha.jpg" \
  -F "alt_text=Iced matcha in a glass"

If you set variant_id on the request, the image belongs to that variant instead of the whole product.

Attach a highlight video

A product can have one highlight video: a short clip that the storefront renders as a small floating widget at the bottom-left of the product page. Click it to expand to fullscreen with sound.

Set it on the product itself, not the gallery:

curl -X PATCH "https://api.mobiari.com/v1/products/$PRODUCT_ID" \
  -H "Authorization: Bearer $MOBIARI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video_url": "https://youtu.be/abc123",
    "video_poster_url": "https://files.example.com/poster.jpg"
  }'

The provider (youtube, vimeo, upload, external) is auto-detected from the URL. You can override it by setting video_provider explicitly.

Gallery videos sit next to gallery images and are useful for product tours, "how it's made", or fit/sizing demos. Unlike the highlight video, they're click-to-play inside the gallery instead of an autoplay widget.

GET /products/{product_id}/images lists them with media_type: "video"; url is the playable URL and poster_url its poster. Adding a video to the gallery by URL is not part of the public API yet.

Listing

Products are sorted by priority (ascending), then most recently updated first. Filters:

Query parameterMeaning
searchCase-insensitive part of the title, the sku_prefix, a variant's SKU or barcode, or the product's GTIN.
statusOnly products in this status.
include_draftsDrafts are hidden unless true (or unless you filter by status).
category_id, collection_idOnly products in this category or collection.
sortpriority (default), updated_at or title.
limitPage size, 1 to 200, default 50.
cursornext_cursor from the previous page. Omit for the first page.
include_totaltrue to also get total.
curl "https://api.mobiari.com/v1/products?search=matcha&limit=50" \
  -H "Authorization: Bearer $MOBIARI_KEY"

The answer is a Page: { "data": [...], "has_more": true, "next_cursor": "…" }. To get the next page, repeat the request with cursor set to next_cursor, until has_more is false:

curl "https://api.mobiari.com/v1/products?search=matcha&limit=50&cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $MOBIARI_KEY"

Paging is by cursor only: offset is refused with 400 offset_not_supported.

Permission cheatsheet

ActionPermission
List, getproducts.read
Create, update, manage mediaproducts.write
Deleteproducts.delete

On this page