CommerceForAI
v0.1.11Run a store on your own Stripe account: products, orders, shipping, returns, print-on-demand.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_store Get store
Store settings: name, currency, test/live mode, whether Stripe events are connected. If stripe_branding.matches is false, tell the owner what customers see and the suggested values; only they can change it in Stripe (fix_url).
chatgpt_channel Chatgpt channel
Sell in ChatGPT: readiness steps (live store, products, storefront links, feed passes OpenAI's rules), the answers to give on OpenAI's merchant application, and the application status. The owner submits the application themselves at chatgpt.com/merchants (it asks for their personal details).
update_chatgpt_channel Update chatgpt channel
Record ChatGPT application progress after the owner tells you (status: applied, approved, not_approved), or set the product category to apply with.
| Parameter | Type | Description |
|---|---|---|
category | string | |
note | string | |
status | string |
check_product_feed Check product feed
Would ChatGPT shopping (OpenAI's product feed spec) accept this store's catalog? Returns per-item errors (would be rejected: e.g. missing JPEG/PNG image, no product URL) and warnings (weaker listings), so you can fix them before the owner applies at chatgpt.com/merchants.
check_storefront Check storefront
After the site is deployed, check it from the outside: is an API key exposed in browser code, do the success page and product pages load, are webhook endpoints reachable and do they refuse unsigned requests. Pass the site's public https address. Each item has a status (done/todo/warning/optional) and the exact fix. Run it after every deploy that changes checkout, and before telling the owner the store is ready.
| Parameter | Type | Description |
|---|---|---|
url * | string | The deployed site's address, e.g. https://yourstore.com |
get_approval Get approval
When a change is over this API key's cap (refund, shipping label, gift card), the error has code approval_required and an approval id: the store owner was asked. Don't retry the change. Pass the id here to see its status; once approved, CommerceForAI has made the change and `result` holds the response. Without an id, lists pending approvals.
| Parameter | Type | Description |
|---|---|---|
id | string | apr_... from the approval_required error |
setup_status Setup status
Start here. Everything between this store and real orders, each with status (done/todo/warning/optional) and the exact fix; plus ready_for_real_orders and next_step.
simulate_order Simulate order
Test stores only: run a purchase end to end without a browser to prove the integration works. Reserves and commits stock, creates a paid order, fires events and the app's webhooks; fulfill: true also marks it shipped. Returns the events, webhook deliveries and the emails a real order would send. Never charges a card, reaches Printify/Printful, emails anyone, or counts toward usage.
| Parameter | Type | Description |
|---|---|---|
items * | array | |
customer_email | string | |
discount_code | string | Apply a discount code, as a shopper would |
fulfill | boolean | |
shipping_rate | object |
configure_checkout_shipping Configure checkout shipping
Set the shipping every checkout offers (unless a checkout passes its own): up to 5 flat rates in cents with optional delivery days, the countries the store ships to, and an optional free-shipping threshold on the item subtotal in cents. Without this, checkouts charge $0 shipping.
| Parameter | Type | Description |
|---|---|---|
countries * | array | |
rates * | array | |
free_over |
import_from_shopify Import from shopify
Move products from Shopify: pass shop (your-store.myshopify.com) and a custom app access_token with read_products and read_inventory, or csv with the contents of Shopify's product export (Products → Export). Imports products, variants (options, SKUs, prices), stock, images and descriptions. Safe to re-run: matches by Shopify id or SKU and keeps existing prices and stock.
| Parameter | Type | Description |
|---|---|---|
access_token | string | |
csv | string | |
customers_csv | string | Contents of Shopify's customer export (Customers → Export). Carries over who is tax-exempt. |
orders_csv | string | Contents of Shopify's order export (Orders → Export). Past orders come over as history: never charged, emailed, fulfilled or counted toward fees. |
shop | string |
import_catalog Import catalog
Import the products already set up in the connected Printify shop or Printful store (both if provider is omitted). Happens automatically when a provider is connected; safe to re-run. Runs in the background: check get_store → fulfillment[].catalog_import for progress.
| Parameter | Type | Description |
|---|---|---|
provider | string |
create_go_live_link Create go live link
When the store is ready for real orders, create a one-time link to give the person. Opening it signs them in, claims the store if needed, creates a live copy with the same products and settings, and takes them to Connect Stripe. Test stores only; the link lasts 7 days.
list_products List products
List products with their variants, prices (in cents) and stock. Pass collection (id or handle) to list one collection's products.
| Parameter | Type | Description |
|---|---|---|
active | boolean | |
collection | string | |
limit | integer | |
q | string | |
starting_after | string |
get_product Get product
Get one product by id.
| Parameter | Type | Description |
|---|---|---|
product_id * | string |
list_inventory List inventory
Tracked variants sorted by available stock (lowest first). Use low_stock_threshold to only see items at or below it.
| Parameter | Type | Description |
|---|---|---|
low_stock_threshold | integer |
list_orders List orders
List orders, newest first. Filter by status: pending_payment, paid (ready to ship), fulfilled, cancelled, refunded.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
starting_after | string | |
status | array |
get_order Get order
Get an order by id (ord_...) or number (e.g. 1001).
| Parameter | Type | Description |
|---|---|---|
order * | string |
list_events List events
Read the store's event log in order (order.created, order.paid, inventory.updated, ...). Pass the last seen event id as `after` to get only new events.
| Parameter | Type | Description |
|---|---|---|
after | string | |
limit | integer | |
type | string |
create_product Create product
Create a product. Prices are in cents. For sizes/colors pass `variants`; otherwise pass `price` (and optionally `inventory`). Omit inventory for unlimited stock.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
description | string | |
images | array | |
inventory | integer | |
price | integer | |
sku | string | |
variants | array |
create_products Create products
Create up to 100 products in one call (much faster than create_product in a loop). Same fields as create_product, plus optional metadata and print-on-demand `fulfillment` per variant. Each product succeeds or fails on its own; the result lists failures by index so you can fix and resend just those.
| Parameter | Type | Description |
|---|---|---|
products * | array |
printify_catalog Printify catalog
Look up Printify's catalog through the store's connected Printify shop (no token needed). Step 1: pass q (e.g. "heavy cotton tee") to find blueprint ids. Step 2: pass blueprint_id to list print providers. Step 3: pass blueprint_id + print_provider_id to get variant ids, option values (color, size) and placements (front, back…).
| Parameter | Type | Description |
|---|---|---|
blueprint_id | integer | |
print_provider_id | integer | |
q | string |
create_in_printify Create in printify
Create one of the store's products in its Printify shop: uploads the artwork, enables and prices each variant, generates mockups, and maps the variants so paid orders go straight to Printify. Variants are matched by option values; use fixed_options for options the product doesn't have (e.g. { color: "Black" } for a size-only tee) or variant_map ({ our_variant_id: printify_variant_id }). Prices must cover Printify's cost. Run once per product.
| Parameter | Type | Description |
|---|---|---|
blueprint_id * | integer | |
print_provider_id * | integer | |
product_id * | string | |
fixed_options | object | |
print_files | array | |
publish | boolean | Also publish to the Printify store's sales channel (e.g. Etsy). Only works when that store is connected to one. |
use_mockups | boolean | |
variant_map | object |
publish_in_printify Publish in printify
Publish a product (already created with create_in_printify) to the connected Printify store's sales channel, such as Etsy. Printify creates the listing; Etsy may show it as a draft first. Refuses if the Printify store isn't linked to a channel. Puts the product in front of real buyers, so confirm with the owner first.
| Parameter | Type | Description |
|---|---|---|
product_id * | string |
upload_image Upload image
Host an image on cdn.commerceforai.com (PNG, JPEG or WebP, up to 25 MB) and get a permanent URL to use for product images, print_files or the email logo. Pass url to copy from a link, or base64 data for a local file. Photo metadata is removed; the same image is stored once.
| Parameter | Type | Description |
|---|---|---|
data | string | base64 file contents (for local files) |
filename | string | |
url | string |
copy_product_images Copy product images
Copy products' images and print files from outside links onto cdn.commerceforai.com and point the products at the copies, so a moved or deleted source can't break the store. Pass product_id for one product; otherwise it does the next batch (repeat until remaining is 0).
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
product_id | string |
preview_store_sync Preview store sync
Preview syncing this store's other version (test or live) into this store: products to add or change, price changes, collections, discounts, settings. Changes nothing. Syncs never touch orders, keys, Stripe, site URLs or stock counts, and leave anything only in this store alone. Show the owner the plan before applying into a live store.
apply_store_sync Apply store sync
Apply a sync into the store this connection belongs to. Into a live store it needs plan_id from preview_store_sync and changes what real customers see and pay, so get the owner's OK on the plan first.
| Parameter | Type | Description |
|---|---|---|
plan_id | string |
sales_tax_status Sales tax status
Sales tax readiness: whether collection is on, Stripe Tax setup status, registered states, the next step, and the tax categories. Stripe collects only where the merchant has added a registration; the merchant registers and files. Don't tell the owner what they legally owe; suggest an accountant.
configure_sales_tax Configure sales tax
Turn Stripe Tax collection on or off, and set the default tax category for products without their own (e.g. txcd_30011000 for clothing; see sales_tax_status for categories). Changes what customers pay, so get the owner's OK. Set one product's category with update_product tax_code.
| Parameter | Type | Description |
|---|---|---|
default_tax_code | string | null | |
enabled | boolean | |
prices_include_tax | boolean | True if listed prices already include tax (common outside the US) |
tax_orders Tax orders
Every real order in a period with its destination and tax, for an accountant or a filing. Dates are YYYY-MM-DD; default the last 365 days.
| Parameter | Type | Description |
|---|---|---|
from | string | |
to | string |
sales_by_state Sales by state
Sales, orders and tax collected by state over the last N days (default 365), with which states are registered. `watch` marks US states near common registration thresholds, worth checking with an accountant; it isn't a legal determination.
| Parameter | Type | Description |
|---|---|---|
days | integer |
update_product Update product
Update a product's name, description, images, or set active=false to stop selling it.
| Parameter | Type | Description |
|---|---|---|
product_id * | string | |
active | boolean | |
description | string | |
images | array | |
name | string | |
tax_code | string | null |
update_variant Update variant
Change a variant's price (cents), name, SKU, or set active=false to stop selling it.
| Parameter | Type | Description |
|---|---|---|
variant_id * | string | |
active | boolean | |
name | string | |
price | integer | |
sku | string |
adjust_inventory Adjust inventory
Change stock for a variant. Use `adjust` for a relative change (+24 after a delivery, -1 for a damaged unit) or `set` for an absolute count after a stocktake. Always give a reason.
| Parameter | Type | Description |
|---|---|---|
reason * | string | |
variant_id * | string | |
adjust | integer | |
set | integer |
create_checkout Create checkout
Create a Stripe-hosted checkout link for a customer. Stock is held until it expires. Returns `url` to send to the customer.
| Parameter | Type | Description |
|---|---|---|
items * | array | |
customer_email | string | |
discount_code | string | Apply this code up front. Otherwise the customer can enter any live code on Stripe's page. |
success_url | string |
fulfill_order Fulfill order
Mark a paid order as shipped, with optional carrier and tracking. Only do this once the package has actually been handed to a carrier. On an order that already shipped, a new tracking number adds another package and emails the customer about it; set replace: true to correct the tracking instead.
| Parameter | Type | Description |
|---|---|---|
order * | string | |
carrier | string | |
items | array | Ship only these (one box of a split order; needs tracking_number). The order's unshipped_items says what's left. |
replace | boolean | |
tracking_number | string | |
tracking_url | string |
save_draft_order Save draft order
Build an order for a customer without them going through the store (a phone order, a wholesale buyer, a quote), or update one by id/number. Each item can have its own unit_price in cents (default: the variant's price). Optional customer, note shown on the invoice, discount_code and a single shipping charge. Returns invoice_url, the customer's page to pay; it becomes a normal order when paid. Holds no stock until the customer pays. Confirm items and prices with the owner first.
| Parameter | Type | Description |
|---|---|---|
customer_email | string | |
customer_name | string | |
discount_code | string | |
draft | string | Id or number of a draft to update; omit to create |
expires_in_days | integer | |
items | array | |
note | string | |
shipping | object |
send_invoice Send invoice
Email a draft order's invoice to its customer (or to `to`), with an optional message. The email has a Pay now link. Sends a real email: confirm with the owner.
| Parameter | Type | Description |
|---|---|---|
draft * | string | |
message | string | |
to | string |
list_draft_orders List draft orders
Draft orders and invoices: open, invoice_sent, completed (paid; see order_id), cancelled or expired.
| Parameter | Type | Description |
|---|---|---|
status | string |
list_subscriptions List subscriptions
Subscriptions (variants sold with `recurring`): status, schedule, customer, and what each renewal contains. Each paid renewal creates a normal order.
| Parameter | Type | Description |
|---|---|---|
email | string | |
status | string |
cancel_subscription Cancel subscription
Cancel a customer's subscription: at the end of the period they've paid for (default), or now with at_period_end false. Confirm with the owner first.
| Parameter | Type | Description |
|---|---|---|
subscription * | string | |
at_period_end | boolean |
edit_order Edit order
Change a paid order before it ships: swap an item for another variant (replace, e.g. a different size), remove or add items, or fix the shipping address or email. Removing something refunds its share of what was charged. A change that costs more is refused unless waive_difference is true (to charge for extras, use save_draft_order instead). Print-on-demand orders affected are cancelled at the provider and sent again; if the provider refuses (already in production), nothing changes. Call with dry_run: true first to see the refund and what will be resent, and confirm with the owner before applyi…
| Parameter | Type | Description |
|---|---|---|
order * | string | |
add | array | |
dry_run | boolean | |
email | string | |
notify_customer | boolean | |
reason | string | |
remove | array | |
replace | array | |
shipping_address | object | |
waive_difference | boolean |
submit_fulfillment Submit fulfillment
Send a paid order to the print-on-demand provider (Printful or Printify) now — e.g. after fixing a missing print file. Orders are normally sent automatically when paid.
| Parameter | Type | Description |
|---|---|---|
order * | string |
add_order_note Add order note
Attach an internal note to an order (not shown to the customer).
| Parameter | Type | Description |
|---|---|---|
note * | string | |
order * | string |
refund_order Refund order
Refund an order through Stripe. Omit amount for the full remaining amount. This tool is limited to $50.00 per refund; a larger one is sent to the store owner to approve (then check get_approval). Set restock=true if the items came back sellable.
| Parameter | Type | Description |
|---|---|---|
order * | string | |
amount | integer | |
reason | string | |
restock | boolean |
list_collections List collections
Collections (product groups like 'Mugs' or 'Yosemite') in display order, with their product ids. Filter products by one with list_products collection.
save_collection Save collection
Create a collection, or update one by id/handle. product_ids replaces its membership in display order; omit it to leave products as they are. The handle defaults from the name.
| Parameter | Type | Description |
|---|---|---|
collection | string | Id or handle of an existing collection to update; omit to create |
description | string | |
handle | string | |
image | string | |
name | string | |
position | integer | |
product_ids | array |
delete_collection Delete collection
Delete a collection. The products themselves are kept.
| Parameter | Type | Description |
|---|---|---|
collection * | string |
list_customers List customers
Customers who've paid, matched by email, with order count and total spent (after refunds). Search by email or name; sort recent, spent or orders.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
page | integer | |
q | string | |
sort | string |
get_customer Get customer
One customer by email: totals, last shipping address and order history.
| Parameter | Type | Description |
|---|---|---|
email * | string |
set_customer_tax_exempt Set customer tax exempt
Mark a customer tax-exempt (wholesale, nonprofit) or remove the exemption. Checkouts created with their customer_email then skip sales tax. Works before their first order. Only do this when the store owner has the customer's exemption certificate.
| Parameter | Type | Description |
|---|---|---|
email * | string | |
tax_exempt * | boolean | |
note | string | For the store's records, e.g. the exemption certificate number |
sales_report Sales report
Sales over the last N days (default 30): orders, gross, net after refunds, discounts, average order, new vs returning customers, change vs the previous period, a time series and top products. Amounts are cents. Simulated orders are excluded.
| Parameter | Type | Description |
|---|---|---|
days | integer |
list_discounts List discounts
Discount codes with status (live, scheduled, expired, used_up, off) and times used.
save_discount Save discount
Create a discount code, or update one by id/code. kind percent (value 1–100) or amount (value in cents). Optional minimum order (cents), usage limit and start/end dates. Live codes work at checkout right away: customers enter them on Stripe's page, or pass discount_code to create_checkout. automatic: true applies it to every qualifying checkout with no code (e.g. 10% off orders over $50; code is then optional and only names it on the receipt). One discount per checkout: a code the shopper or checkout supplies replaces the automatic one. Confirm the terms with the owner before creating a disc…
| Parameter | Type | Description |
|---|---|---|
active | boolean | |
automatic | boolean | Apply without a code to every checkout that qualifies |
code | string | |
discount | string | Id or code of an existing discount to update; omit to create |
ends_at | string | null | |
kind | string | |
max_redemptions | ||
min_subtotal | ||
starts_at | string | null | |
value | integer |
issue_gift_card Issue gift card
Issue a gift card worth `value` cents (store credit, a prize, a replacement). With send: true and recipient_email, the code is emailed with your optional message. Customers enter the code like a discount code; unspent balance stays on the card. To sell gift cards instead, create a product with metadata { gift_card: "true" }. Confirm the value with the owner first.
| Parameter | Type | Description |
|---|---|---|
value * | integer | |
expires_at | string | |
message | string | |
note | string | |
recipient_email | string | |
send | boolean |
list_gift_cards List gift cards
Gift cards with their balances and status. To look one up by code or last 4, use update_gift_card with no changes, or get it via the API.
update_gift_card Update gift card
Change a gift card by id, code or last 4: active false disables it, balance sets what's left (to add value), or resend the code with send_to.
| Parameter | Type | Description |
|---|---|---|
card * | string | |
active | boolean | |
balance | integer | |
note | string | |
send_to | string |
delete_discount Delete discount
Delete a discount code. It stops working at checkout immediately. To pause it instead, save_discount with active: false.
| Parameter | Type | Description |
|---|---|---|
discount * | string |
brand_emails Brand emails
Brand the customer emails (order confirmation, shipped, refund, return, cart reminder): an https logo URL, an accent hex color for buttons, and the address shown in the footer. Also sets team alerts: new_order (an email per sale) and low_stock_threshold (email when a variant's stock falls to it; null = off). Then use send_test_emails so the owner can see them.
| Parameter | Type | Description |
|---|---|---|
accent_color | string | null | |
address | string | null | |
logo_url | ||
low_stock_threshold | ||
new_order_alerts | boolean |
send_test_emails Send test emails
Email the store owner a preview of every customer email (or one template) with the store's branding and sample data from its products. Only goes to the store's own members.
| Parameter | Type | Description |
|---|---|---|
template | string |
list_returns List returns
List returns, newest first. Status: requested (needs a decision), approved (waiting for items), rejected, completed.
| Parameter | Type | Description |
|---|---|---|
order | string | |
status | string |
get_shipping_rates Get shipping rates
Get live shipping label rates for a paid order (cheapest first). Parcel weight comes from variant weights unless you pass parcel. Pass return_id for return-label rates.
| Parameter | Type | Description |
|---|---|---|
order * | string | |
parcel | object | |
return_id | string |
buy_shipping_label Buy shipping label
Buy a shipping label for a rate from get_shipping_rates. This charges the merchant's carrier account and marks the order shipped (the customer gets a tracking email). Limited to $50.00 per label.
| Parameter | Type | Description |
|---|---|---|
order * | string | |
rate_id * | string |
create_return Create return
Open a return for items on a shipped order.
| Parameter | Type | Description |
|---|---|---|
items * | array | |
order * | string | |
reason | string |
approve_return Approve return
Approve a requested return. Set prepaid_label=true to buy the cheapest return label and email it to the customer.
| Parameter | Type | Description |
|---|---|---|
return_id * | string | |
note | string | |
prepaid_label | boolean |
reject_return Reject return
Reject a return request, with a note explaining why.
| Parameter | Type | Description |
|---|---|---|
note * | string | |
return_id * | string |
receive_return Receive return
Record that returned items arrived. Restocks them (unless restock=false) and refunds their value through Stripe (unless refund=false). The refund is subject to the $50.00 per-refund limit.
| Parameter | Type | Description |
|---|---|---|
return_id * | string | |
refund | boolean | |
restock | boolean |