REST API quickstart
Everything the TitanCart admin app does, it does through the store’s REST API, and the storefront reads the catalogue the same way. That API is open to you too. This quickstart covers the three ways in: the public store endpoints for reading the catalogue from a mobile app or another site, the admin endpoints for managing products, orders and customers from your own systems, and outbound webhooks that notify your systems when something happens. It also explains where the API Keys card fits in this release, so you do not build on it before it is ready.
Every request goes to https://your-store.com/wp-json/titancart/v1/ and answers with JSON. Replace your-store.com throughout.
1. Read the catalogue: the public store endpoints
These need no credentials; they are what the storefront pages use. Available in TitanCart Lite and Pro.
curl "https://your-store.com/wp-json/titancart/v1/store/products?per_page=5&sort=price&order=asc"
Response: { "products": [ … ], "total": 42, "total_pages": 9, "page": 1, "filter": { … } }. Each product carries id, name, slug, url, price, list_price, sku (the product code), stock_status, stock_quantity, featured, rating_avg, rating_count, image, short_desc, brand, brand_url, features and has_variations.
Query parameters: category (slug), search, price_min, price_max, stock=in_stock, brand, tag, sort and order, page and per_page (up to 48). Only active products are returned.
GET /store/products/{id}— one product in full: description, categories, image and attributes, and whether it has variations.GET /store/products/by-ids?ids=12,15,20— several products at once.GET /store/categories— the category tree.GET /store/filtersandGET /store/search-suggest?q=tote— the filter definitions and search suggestions the storefront uses.GET /coupon/{CODE}/check— whether a coupon code is valid (Pro, with Promotions enabled).
The cart and checkout endpoints (/cart, /cart/items, /checkout/…) are public too, but they act on the caller’s own cart-session cookie, so they are useful from a browser, not from a server.
2. Manage the store: admin endpoints
The admin endpoints are the same routes the TitanCart admin app calls, and they require a WordPress administrator. From your own code the way to authenticate is a WordPress application password, which is built into WordPress and needs HTTPS:
- In WordPress open Users → Profile for an administrator account you create for the integration, scroll to Application Passwords, enter a name such as Warehouse sync and click Add New Application Password. Copy the 24-character password now; WordPress shows it once.
- Send it with HTTP Basic authentication:
curl -u "integration-user:xxxx xxxx xxxx xxxx xxxx xxxx"
"https://your-store.com/wp-json/titancart/v1/orders?per_page=10&status=processing"
Without credentials the admin routes refuse: the catalogue routes (products, attributes, options, filters) answer 403 {"code":"tc_rest_forbidden","message":"Forbidden."}, and the rest (orders, customers and the others) answer 401 {"code":"rest_forbidden","message":"Sorry, you are not allowed to do that."}. Revoke the application password from the same profile screen to cut the integration off.
Products. GET /products lists them with page, per_page (24), search, status (active, disabled or hidden), category_id, ids, sort_by (name, price, position, date, sales, rating or discount) and sort_order. The body holds products, total, total_pages and page, and the same totals come back as X-TC-Total, X-TC-Total-Pages and X-TC-Page headers. GET /products/{id} returns the full record (name, descriptions, meta title and description, prices, categories, images, options, attributes, videos, tags, URL); POST /products creates, PUT /products/{id} updates, DELETE /products/{id} deletes, and /products/{id}/stock and /products/{id}/images handle stock and images on their own.
Orders. GET /orders takes page, per_page (20, at most 100), status (a status handle such as processing), search, date_from, date_to, orderby (id, created_at, total, status_id or billing_email) and order. The body holds orders, total, pages, page and per_page; headers X-TC-Total and X-TC-TotalPages. Each order carries its columns plus status_handle, status_label, payment_method and shipping_method; GET /orders/{id} adds items, notes and history. To move an order, PATCH /orders/{id}/status with {"status":"completed","comment":"Shipped via UPS","notify":true}; notify sends the customer the status e-mail exactly as the admin app would (see Order statuses). GET /orders/statuses lists the handles.
Customers, categories, everything else. GET /customers (search, status, page, per_page up to 100) and GET /customers/{id}; GET /categories and GET /categories/tree; and one route per admin page (shipping, tax, promotions, reports, settings). Open the browser’s network panel while using the admin app to see the exact call for any screen. Routes behind a Pro feature answer 403 {"code":"upgrade_required"} on Lite.
Notes: pagination header names differ a little between resources (always read the totals from the body if in doubt); the WordPress batch endpoint /batch/v1 is disabled on TitanCart sites; and the Pro Access Restriction IP allow-list for administrators also applies to the integration user when it signs in with an application password.
3. Be told when things happen: webhooks
Webhooks (Pro) POST a JSON message to a URL of yours when an event fires. Open TitanCart → API & Integrations, Webhooks tab, + New Webhook:
- Endpoint URL — your HTTPS listener.
- Secret (used to sign payloads — optional) — type your own, or leave it blank and TitanCart generates one. A generated secret is shown once, right after you create the webhook (“Copy the signing secret now — it will never be shown again”), so copy it then; it cannot be looked up later.
- Subscribe to Events — tick the ones you need, then Create Webhook.
Events: order.created (fires when payment is confirmed, not when the cart is submitted), order.status_changed, order.completed, order.cancelled, product.created, product.updated, product.deleted, product.low_stock, customer.created and customer.updated.
The request. A POST with Content-Type: application/json and the headers X-TC-Event (the event name), X-TC-Signature and X-TC-Attempt. The body is { "event": "order.created", "fired_at": "2026-11-04T10:57:00+00:00", "data": { … } }. Order events carry order_id, order_number, status, email, total, currency and created_at (status changes add old_status and new_status); product events carry product_id, product_code, name, status, price and stock; customer events carry the customer’s id, user id, e-mail, name and status, with a changed list on updates. Fetch the full record from the admin endpoints when you need more.
Verify the signature. X-TC-Signature is sha256= followed by the HMAC-SHA256 of the raw request body using your secret. In PHP:
$raw = file_get_contents( 'php://input' );
$mine = 'sha256=' . hash_hmac( 'sha256', $raw, $secret );
if ( ! hash_equals( $mine, $_SERVER['HTTP_X_TC_SIGNATURE'] ?? '' ) ) { http_response_code( 401 ); exit; }
Answer with any status below 300 within 15 seconds. Delivery and retries: deliveries are queued and sent by WP-Cron, so they go out on the next site visit or on your real cron tick. A failed delivery is retried after 30 seconds and again after 5 minutes (three attempts in all; X-TC-Attempt tells you which). After ten consecutive failures the webhook’s status becomes failed and nothing more is sent until you fix the endpoint and Resume it; the row shows an “N failures” badge meanwhile. Use Test on a row to send a test event immediately, and Pause to stop deliveries without deleting the subscription. Every attempt is logged with the response code; the log is available at GET /webhooks/{id}/logs with admin credentials.
4. API keys: the keyed Store API
The API Keys tab (+ New Key: a Description, Permissions (Read only in this release) and a Rate Limit per minute) issues a public key and a secret, shown once (“Copy the secret now — it will never be shown again”). Send them as the headers X-TC-Key and X-TC-Secret to the keyed Store API, which lives under /wp-json/titancart/v1/api/store/ (TitanCart 0.2.73 and later; the plain /store/ endpoints in section 1 stay public and never read a key):
curl -H "X-TC-Key: tc_pk_..." -H "X-TC-Secret: ..."
"https://your-store.com/wp-json/titancart/v1/api/store/products?per_page=5&sort_by=price&sort_order=asc"
GET /api/store/products— active products;page,per_page(up to 100),category_id,search,min_price,max_price,in_stock=true,sort_by(name, price, position, date, sales, rating, discount),sort_order,lang.GET /api/store/products/{id}— one active product with description, images, options, attributes, tier prices and category ids.GET /api/store/categories— the active category tree, or?format=flat;GET /api/store/categories/{id}adds the breadcrumb and direct children.GET /api/store/orders/{id}?token=…— one order with items, addresses and totals; the token is the order key from the confirmation page (an administrator session works without it).
Every answer is { "success": true, "data": …, "meta": { "page", "per_page", "total", "pages" } }; a missing or inactive item is a 404 with { "success": false, "error": "…" }. Credential problems come back WordPress-style: 401 tc_api_unauthorized (missing or wrong key or secret), 403 tc_api_key_revoked, and 429 tc_api_rate_limited with a Retry-After header when the key’s per-minute limit is reached. The window is the clock minute and the count is exact under parallel load: at a limit of 60, sixty simultaneous calls all succeed and the sixty-first is the first 429 (TitanCart 0.2.75 and later; earlier releases let a burst of simultaneous calls slip past the limit). Each key’s Logs button lists its recent requests with method, endpoint, status and duration. Revoking a key is immediate and cannot be undone. Write access is not offered yet: no write route exists, so a key reads the catalogue and nothing else.
5. Lite and Pro
TitanCart Lite has the public store endpoints, the cart and checkout endpoints and the admin endpoints with application passwords. The API & Integrations page, API keys and webhooks are Pro: on Lite those routes do not exist (404 rest_no_route).
Troubleshooting
- 403 “Forbidden.” or 401 “Sorry, you are not allowed to do that.” on an admin route. The request reached WordPress as nobody: no credentials, or the user is not an administrator. Application passwords only work over HTTPS and only when the user has not been blocked by Access Restriction.
- The same refusal with a correct application password. WordPress answers the same anonymous refusal whether the password was wrong, the login unknown, or the password never checked at all, so work through these in order:
- The password was created on a different site. The commonest cause: the password exists on staging, on a sub-site or on another installation, not on the one you are calling. WordPress also only starts checking application passwords once the first one has ever been created on a site, so a site that never had one ignores every password silently. Create the password on the site you are calling, under its own Users → Profile. To confirm which state a site is in, over SSH or WP-CLI run
wp option get using_application_passwords: “1” means the site has had at least one; an error that the option does not exist means none was ever created there. - The host drops the
Authorizationheader. Some Apache setups with PHP-FPM never hand it to PHP. WordPress writes the usual.htaccessfix itself (theRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]line); if that line is missing add it inside the WordPress block, or on Apache 2.4.13 or newer putCGIPassAuth Onabove the block. nginx passes the header through as is. - Login or password. The first half is the WordPress username (or the account’s e-mail address), not the name you gave the application password. The spaces WordPress shows in the password are fine inside the quotes.
- The password was created on a different site. The commonest cause: the password exists on staging, on a sub-site or on another installation, not on the one you are calling. WordPress also only starts checking application passwords once the first one has ever been created on a site, so a site that never had one ignores every password silently. Create the password on the site you are calling, under its own Users → Profile. To confirm which state a site is in, over SSH or WP-CLI run
- Webhooks arrive late or in bursts. WP-Cron runs with page views. Point a real cron job at
wp-cron.phpevery minute and defineDISABLE_WP_CRONinwp-config.php. - Signatures never match. Compute the HMAC over the raw body bytes, not a re-encoded version, with the secret you typed or copied when the webhook was created. If a generated secret was never copied, delete the webhook and create it again with a secret of your own.
- A webhook stopped after a while. Ten failures in a row set it to failed; fix the endpoint and click Resume.
/store/productsomits a product. Only active products are listed, as on the storefront; disabled and hidden ones are not.
See also
- Managing orders — what the order fields mean.
- Order statuses — the handles you pass to the status route.
- Bulk CSV import — the non-API way to load a catalogue.
- Product Data Feeds — scheduled catalogue exports for Google and Facebook.
- Settings overview