How to call the LitCommerce API
This article guides you through authenticating, using API tools, and tracking a background job with the LitCommerce API.
[!INFO]
- You must create an API token first. See Set up AI and API connections in LitCommerce for more details.
- The base address for all API calls is
https://mcp.litcommerce.com.
- An API token is scoped to one Main Store, so
store_idis not required. If provided, the value must match the store associated with the token.
Test the API in your browser
Follow the steps below to proceed.
-
Copy your generated LitCommerce API tokens.
-
Open
https://mcp.litcommerce.com/docsfor the interactive page. -
Click
Authorize, paste your token, and confirm withAuthorize.

[!INFO] The API token is stored in your browser. The full machine-readable specification is available at
https://mcp.litcommerce.com/api/v1/openapi.json, including action inputs, permissions, limits, and error codes.
Send API requests
[!INFO]
- Send
Authorization: Bearer lc_live_...on every request.- Request bodies are JSON up to 1 MB.
- Image uploads use a separate upload endpoint (up to 10 MB per image).
| Method and path | Use |
|---|---|
GET /api/v1/tools |
List the actions available to your token, with their input schema |
POST /api/v1/tools/{name} |
Call one action; the JSON body is the action input |
GET /api/v1/operations/{op_id} |
Status of a background job; same as get_operation |
- To list the actions:
curl https://mcp.litcommerce.com/api/v1/tools \
-H "Authorization: Bearer $LITCOMMERCE_TOKEN"
[!INFO] The reply shows your Main Store type (
cartorlitc) and the actions you can call. Actions that do not fit your Main Store or permissions are not listed.
- To call an action that only looks up data:
curl -X POST https://mcp.litcommerce.com/api/v1/tools/find_products \
-H "Authorization: Bearer $LITCOMMERCE_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status": "active", "in_stock": false, "limit": 20}'
If the reply has next_cursor, send it back as cursor to get the next page.
Perform update actions via API
Actions that modify data use a three-step process: preview, then confirm, and apply. Refer to Manage your LitCommerce data with AI and API tools for how the preview and confirmation work.
| Field | What it does |
|---|---|
dry_run |
true (default) previews only. false applies the change. |
confirmation_token |
Proves the plan was previewed. Valid for 10 minutes, single use, and tied to that exact plan. |
idempotency_key |
A value you choose, at least 8 characters. Sending the same key with the same input returns the earlier result (idempotent_replay: true) instead of changing the data twice. |
-
Preview
Call the action without
dry_run. The reply contains theplanand aconfirmation_token.curl -X POST https://mcp.litcommerce.com/api/v1/tools/update_inventory \ -H "Authorization: Bearer $LITCOMMERCE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"items": [{"product_id": "<id>", "qty": 20}]}' -
Confirm
Check the proposed changes to ensure all included data is correct and the proposed updates match your intent.
-
Apply
Call the action again with the same
items, plusdry_run,confirmation_token, andidempotency_key.curl -X POST https://mcp.litcommerce.com/api/v1/tools/update_inventory \ -H "Authorization: Bearer $LITCOMMERCE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"items": [{"product_id": "<id>", "qty": 20}], "dry_run": false, "confirmation_token": "<token>", "idempotency_key": "stock-2026-11-23-001"}'The exact item fields for each action are in the action's schema from
GET /api/v1/tools.
[!INFO]
update_inventoryworks only with LitCommerce as the Main Store. If your Main Store is a shopping cart, the request returnswrong_main_store.
Track background jobs
When a response includes an op_id, check the operation status at GET /api/v1/operations/{op_id}. Wait the number of seconds specified in next_check_after before checking again.
FAQs
See the recommended solution for each scenario below:
-
Lost the response or a network error: Call again with the same
idempotency_keyand the same input. You get the earlier result. -
Same key, different input: The call is rejected with
idempotency_key_reused(HTTP 409). Use a new key whenever the input changes. -
Encounter
previous_attempt_failedoroutcome_unknown: Check the result with a lookup action first, then preview again with a new key.
The action returns plan_changed and writes nothing. Preview again and confirm the new proposed change.
The response is 429 with a Retry-After header. Limits are counted per store and shared by the MCP server and the API.
Open the Rate Limits tab in API/MCP to see your current usage. Available limits vary depending on your subscription plan and listing allowance.
Errors have the form {"error": "<code>", "message": "<description>"}. See What do the API error codes mean?.
If you have any questions, let us know via the Chat Box in the bottom-right corner of our Help Center.