# Importing products from a website: user guide

Use this guide to review product access and verify a connection in Cast Motive. Give the website owner the [Product API reference](provider-api.md) and [schema](openapi.json).

## Workspace access

Use Log in with the existing account provided by your workspace administrator. If you cannot sign in or your workspace is missing, ask the administrator to check your access. An Admin manages workspace access, settings and connections. A User can view the catalog and publishing status and prepare their own unapproved manual drafts for Admin review.

## What to request from the website owner

The smallest integration needs one read-only product endpoint. The same endpoint lists products and looks up specified product IDs for their current stock and price. Customer, order, payment, website administration and product-write permissions are unnecessary.

You can send the following request to your website developer:

> Please provide read-only access to published products, with stable IDs, names, public URLs, descriptions, original image URLs and stock availability. Support pagination for the catalog and exact product-ID lookups for current stock/price. Include price/currency, quantity and category when available. Separate stock, category, image and health endpoints are not required. For a private API, provide a product-read-only token. Follow provider-api.md/openapi.json, or share your existing API documentation so an adapter can map it.

The website can use any technology. Existing compatible APIs may avoid new development, but field/auth/pagination mapping and validation are still necessary. An API or feed that uses a different contract requires an adapter.

## Connect the website

1. With Admin access, open Connections → Websites and select Manage for the website.
2. Enter the public HTTPS endpoint and the operation paths supplied by the website owner.
3. Choose public access only for an intentionally public API. Otherwise enter a product-read-only token in the secure form.
4. Save the connection and review the result of a deliberate read when available.

Enter credentials only in the designated secure connection form over HTTPS. Never put keys in chat, screenshots, query strings, browser localStorage or public files. Access must be authorized by the website owner.

## Stock and price

- `in_stock`: the provider reports availability. With minimum stock one, availability can support the initial stock gate.
- `out_of_stock`: keep the post Pending/held.
- `unknown`, missing products or failed requests: do not infer stock; hold the post.
- Minimum stock five requires fresh numeric quantity. Missing quantity must not be interpreted as five available units.
- Missing price allows a post without price; it never means free or zero. A supplied price needs its currency.
- Missing description/images means incomplete product data. Do not ask AI to fabricate the missing facts.

Before a real publication attempt, query the same product endpoint again for current stock/price. Passing this check does not replace approval, destination or scheduling checks.

## Two different statuses

| Status | Meaning |
|---|---|
| Website sync status | Whether product reads work; last check/success, errors and checkpoint |
| Product availability | Whether a specific product is available, unavailable or unknown |

A connected website does not mean all products are in stock or that Facebook is connected. Saving an AI key does not activate website imports. Cast Motive records its own sync history; the website does not need another status endpoint.

## Troubleshooting

| Problem | Action |
|---|---|
| 401/403 | Ask the website owner to correct the read-only credential/permission |
| 404 | Check the endpoint URL and API version |
| 429 | Respect the provider limit/backoff; do not repeatedly retry manually |
| Timeout/500/503 | Wait for recovery; retain saved products and history |
| Requested product missing | Check deletion/private status; hold its post |
| Pagination never completes | Correct the pagination contract; do not delete data from an incomplete scan |

## Optional enhancements

Webhooks, changed-since filters, categories, image APIs, health endpoints and separate stock endpoints are not initial requirements. Delta feeds and webhooks may improve large-catalog efficiency later. AI produces captions and helps select candidates; the website remains authoritative for product facts, price and stock.

## Example workflow

The workflow starts with website products and applied rules, then moves through candidate preparation, review, a fresh stock check and an authorized destination. Live imports, AI and delivery require separate verification.

## Configure AI separately

When AI configuration is available, open AI services and choose Configure AI. Select a role or All roles and choose from the available provider and model options.

Enter credentials only in the secure setup form. Where supported, leave saved fields blank to keep their values. Save configuration, then review the status of the credential and role choices.

Saving configuration records your selections. Verify provider access separately and check availability before requesting preparation.
