Stackless for FluentCart REST API Reference
Stackless for FluentCart exposes a small REST surface for currency, product settings, public storefront data and software licenses. Routes are available when their owning module is switched on.
Use authenticated server-side requests for administrative changes. Never put an application password or administrator credential in browser JavaScript or a public code example.
Base URL and Authentication
Append the route to your site’s WordPress REST base:
https://example.com/wp-json/gt-extensions-fluentcart/v1
Public storefront routes do not require an administrator account. Administrative routes require the documented permission. A signed-in WordPress admin request uses its REST nonce; an external administrative integration can use an application password over HTTPS.
Public Storefront Routes
These routes power customer-facing behavior, with their own input and purchase validation.
- GET /sold-count/{id}: returns product_id, sold_count and badge_html for the product ID.
- GET /currency: returns currency context; accepts an optional cart_hash and uses no-store response headers.
- POST /currency: accepts currency and optional cart_hash, reprices the cart and returns the new currency/reload result. A locked invoice checkout cannot freely change currency.
- GET /external-products/resolve: resolves enabled published external products. It accepts bounded product and variation ID lists, up to 50 of each.
Administrative Product Routes
Price-book, quantity and button-text writes require manage_options.
- GET /variation/{id}/prices reads manual and resolved currency prices.
- POST /variation/{id}/prices saves currency, item_price, compare_price and signup_fee using decimal amounts.
- DELETE /variation/{id}/prices?currency=INR removes that currency’s fixed override.
- POST /rates/refresh refreshes rates through the configured provider.
- POST /variation/{id}/quantity-limits sets min_quantity, max_quantity and quantity_step.
- POST /variation/{id}/button-text sets add_to_cart_text and buy_now_text.
The id in these routes is a variation ID. It is different from the parent product ID used in the quote-form shortcode.
Example Price Payload
For an enabled non-base currency, the price-book request body can look like this:
{"currency":"INR","item_price":"799.00","compare_price":"999.00","signup_fee":"0.00"}
Amounts are entered as decimal currency values; internal pricing records use minor units. Read the returned manual and resolved prices to confirm the intended result.
Service Product Routes
Service products use separate FluentCart product permissions.
- GET /service-products?ids=123,456 requires products/view or administrator access and returns which supplied product IDs are services.
- POST /service-products requires products/create or administrator access and creates a supported service product from its product title and detail data.
- Advanced variations still require the corresponding FluentCart capability. The service creation route rejects unsupported bundle creation.
Software Licensing Routes
Software Licensing has its own namespace. Your plugin or theme calls these routes with the license key as its only credential, so they need no WordPress account. Send them over HTTPS.
https://example.com/wp-json/gtfc/v1/licenses/
- POST /activate: license_key and site_url, with optional instance_id and slug or product_id. Returns activated or already_active with the license details and activation_id, or activation_limit_reached (409) when the key has no free site.
- POST /deactivate: license_key and site_url, with optional slug or product_id. Returns deactivated, or site_not_active (404).
- GET or POST /check (alias /validate): license_key, with optional site_url and slug or product_id. Always answers 200 with valid true or false; when it is false, success is false and code gives the reason.
- GET or POST /version: license_key and slug (or product_id), with optional site_url and the installed version. Returns the WordPress update shape, such as new_version, package, tested, requires and sections. package is filled in only for an active key on an activated site.
- GET or POST /info: slug, with optional license_key and site_url. Returns the WordPress plugin details shape for the View details popup, or unknown_product (404).
- GET /download: the signed package link that version and info return, with license, product, expires, signature and optional version and channel. Use the link as given; an invalid or expired one gets invalid_download (403).
Every response has success, code and message. A missing key gets missing_license (400) and an unusable site URL gets invalid_site (400). Unknown, mistyped and wrong-product keys all get invalid_license (403). Expired, revoked and inactive keys get license_expired, license_revoked or license_inactive. Over the rate limit, a route answers rate_limited (429) with a Retry-After header. For setup, a client example and a full response, see the Software Licensing guide.
Forms and Admin Actions
Not every plugin action is a REST endpoint. Customer forms use WordPress admin-ajax.php with their supplied nonce and ownership checks.
- gtfc_wishlist and gtfc_wishlist_move manage wishlist actions.
- gtfc_saved_cart requires sign-in and handles save, restore, delete and eligible order-again actions.
- gtfc_request_quote submits a quote inquiry.
- gtfc_stock_alert submits an availability request.
- gtfc_checkout_fields saves applicable checkout options.
- gtfc_delivery_slot updates the checkout’s slot selection.
Invoice editing and issue/send/cancel operations use authorized admin actions with their own state and nonce checks. They are not a general-purpose public invoice API. Use the supported admin workflow unless you are implementing and validating an explicit integration.
Handle Errors
Check the HTTP status and error message before using a response. Validate product and variation IDs, permissions, enabled currencies and current cart state. Do not retry a payment or invoice-issuing operation blindly after an uncertain response; first establish whether the original operation succeeded.