Product API reference
Provide catalog products and exact-ID stock and price lookups through a website-owned endpoint.
Cast Motive documentation · Reviewed 9 November 2026
On this page
Read-only operations
The website owner supplies the public HTTPS URL. The same Product API contract applies to catalog listing and exact-ID lookup. Configure one shared endpoint or separate paths on the same host.
Pagination and exact lookups
Use one filter per request. Both filters accept up to 100 distinct comma-separated IDs. For either lookup, use page 1 and set per_page to the number of requested IDs. Return meta.current_page and meta.last_page as 1, echo per_page, and include Cache-Control: no-store. Omit missing or unpublished products and variants. Return resource: [] when nothing matches.
| Input | Contract |
|---|---|
| page | Starts at 1. Read the next page when meta.current_page is lower than meta.last_page. |
| per_page | Catalog page size from 1 to 100, counting product rows. |
| ids | Parent or standalone product IDs. A matching parent can include its published variants. |
| variant_ids | Exact IDs from variants[].id. Include only the requested variants under their parent. |
Response format
Return a resource array and a meta object with integer current_page, last_page and per_page. Echo the requested page and page size.
In resource rows, name can supply the title and image.url can supply a single image. Include the public product URL. The existing Shope endpoint can use its url_slug or ID. When present, current_stock is the count of sellable units. Availability describes stock. Published products can be out of stock, and stock availability does not determine publication.
For an exact stock lookup, supply a fresh, nonnegative integer current_stock and return Cache-Control: no-store. A null or missing current_stock gives unknown stock. Provide price and currency for posts that show pricing. AI preparation needs a real description and a public image in the saved catalog.
The existing Shope external products route receives status=true for catalog and both exact lookups. Apply the published and approved product filter before producing the response. With this filter applied, the response can omit parent status. When included, status must be boolean.
Products with variants
For catalog pages, page size counts parent products. A product with variants appears once in resource. The parent supplies shared title, description, URL, images and currency. Each variant supplies a stable ID and its own price and current_stock. Label and options are optional. If neither is supplied, Cast Motive uses the parent product title. A variant can override the public URL and images. For catalog and ids lookup, a simple product can omit variants or send variants: []. Use its own price and stock. Keep product IDs unique among products and variant IDs unique among variants. Standalone products and sellable variants must also have distinct IDs within the same catalog.
A standard response supports up to 100 variants per parent and 1,000 sellable items across the page. Reviewed discovery can have a lower approved limit.
GET /products?page=1&per_page=1&ids=product:48 selects product:48 and can return all of its published variants under that parent.
GET /products?page=1&per_page=1&variant_ids=variant:481 selects the ID from variants[].id. Return the matching parent with only variant:481 in its variants array.
{
"resource": [
{
"id": "product:48",
"title": "Cotton crew-neck T-shirt",
"description": "Black cotton crew-neck T-shirt.",
"url": "https://shop.example/products/t-shirt",
"images": [
"https://shop.example/media/t-shirt-black.jpg"
],
"currency": "USD",
"variants": [
{
"id": "variant:481",
"options": {
"Color": "Black",
"Size": "M"
},
"price": "19.99",
"current_stock": 8,
"url": "https://shop.example/products/t-shirt?variant=481"
},
{
"id": "variant:482",
"options": {
"Color": "Black",
"Size": "L"
},
"price": "24.99",
"current_stock": 2,
"url": "https://shop.example/products/t-shirt?variant=482"
}
]
}
],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 1
}
}Product fields
| Field | Meaning |
|---|---|
| id | Stable ID for each product parent, simple product or sellable variant. |
| title, description | Product name and description from the catalog. |
| url, images | Use absolute public HTTP(S) URLs. Cast Motive encodes literal spaces in an image path or query as %20, for example https://shop.example/images/Blue%20Shirt.jpg. |
| current_stock | Sellable unit count. Zero means out of stock. Required for exact stock evidence. |
| availability, stock_quantity | Catalog fallback when current_stock is absent. |
| price, currency | Provide the decimal price on each sellable item and the currency on its parent product. |
| variants | Optional array of sellable variants. An empty array is a simple product for catalog and ids lookups. An exact variant lookup must return the selected variant. |
Optional product category
Add category to the product object in resource. Providers may omit category entirely. For a product with variants, put category on the parent product. Its variants inherit that category.
| Form | Field on the product object |
|---|---|
| String | "category": "Clothing" |
| Object with a name | "category": {"name": "Clothing"} |