MageHQ API Documentation

API documentation for connecting Magento, AI Commerce and external systems with reliable developer workflows

Use this API documentation hub to guide developers through authentication, REST endpoints, AI Commerce execution, subscription access, license validation, webhooks, error handling, versioning and production integration best practices.

REST APIsDocument endpoints for AI Commerce, subscriptions, customers, licenses, plans and usage.
WebhooksExplain event payloads for billing, quota, license status, orders and module execution.
DevelopersProvide examples, schemas, errors, security rules and production integration notes.
Developer API hub

Connect MageHQ modules to Magento workflows and external platforms

API Docs
API Readiness
Auth · endpoints · payloads · webhooks · monitoring
Ready
AI Commerce executionPOST
Subscription and license accessGET
Usage, quota and webhooksTracked
AuthSecure API access.
BuildUse clean examples.
MonitorTrack errors and usage.
API documentation areas

Choose the API area you need

Use these cards as entry points for developer documentation, module-specific API references and integration guides.

AI Commerce API

Execute AI features, route providers, track credits, validate quota and return module responses.

Open AI Commerce

Subscription API

Read plans, check subscription status, handle trials, upgrades, renewals and customer access.

View subscriptions

License API

Validate license keys, domain access, module downloads, plan entitlements and customer permissions.

Browse modules

Webhook Events

Document payloads for payment changes, subscription updates, quota alerts and AI execution events.

Request webhook docs

Developer SDK

Describe helper classes, service contracts, client wrappers, DTOs, retries and response mapping.

View development

Search API

Use AI Search endpoints for query understanding, suggestions, product matching and no-result recovery.

View AI Search

Content API

Generate product copy, category content, metadata, SEO text, prompts and approval workflow data.

View content

Reporting API

Expose usage, quota, subscription, AI module performance, error logs and conversion signals.

View resources
Getting started

API integration flow for Magento developers

Use this section to explain the standard developer workflow before connecting MageHQ APIs to Magento modules, storefront components or external systems.

1

Create API credentials

Generate an integration token or module API key, assign the correct ACL permissions and store credentials securely.

Authorization: Bearer <access_token> Content-Type: application/json Accept: application/json
2

Select the API scope

Choose the correct store view, customer context, plan access, AI feature key, provider route and quota behavior.

3

Send the request

Use JSON payloads, idempotency keys for write operations, retry-safe design and clear error handling.

{ "store_id": 1, "feature": "ai_search", "input": { "query": "black running shoes", "customer_group_id": 1 } }
4

Validate response and logs

Check response status, quota usage, provider metadata, execution logs, fallback behavior and customer-facing output.

Sample endpoints

Example API endpoints for MageHQ documentation pages

Replace these placeholder routes with your exact Magento REST paths as your product API contracts become final.

POST

Execute AI feature

Run an AI module through AI Commerce OS with plan, quota and provider routing.

/rest/V1/magehq-ai/feature/execute
{ "feature": "ai_content", "store_id": 1, "input": { "entity_type": "product", "entity_id": 123 } }
GET

Get subscription access

Return active plan, allowed modules, trial status, renewal status and entitlement metadata.

/rest/V1/magehq-subscription/access/:customerId
{ "customer_id": 25, "plan": "AI Growth", "status": "active", "modules": ["ai_search", "ai_chatbot"] }
GET

Check AI quota

Return available credits, used credits, current period, feature limits and reset date.

/rest/V1/magehq-ai/quota/:customerId
{ "credits_total": 100000, "credits_used": 24880, "credits_remaining": 75120, "reset_at": "2026-07-01T00:00:00Z" }
POST

Validate license

Validate module access, license key, domain, plan entitlement and download eligibility.

/rest/V1/magehq-license/validate
{ "license_key": "XXXX-XXXX-XXXX", "domain": "example.com", "module": "Magehq_AISearch" }
POST

Receive webhook event

Handle billing, quota, license, AI execution or plan access changes from MageHQ services.

/webhook/magehq/event
{ "event": "subscription.updated", "id": "evt_123", "created_at": "2026-06-16T10:00:00Z", "data": {} }
GET

Get module download package

Return the correct download package for a plan instead of forcing customers to download each module separately.

/rest/V1/magehq-plan/download/:planId
{ "plan_id": 3, "download_type": "plan", "package": "magehq-ai-growth-suite.zip" }
Schemas and responses

Document request schemas, response models and error formats

Keep API documentation consistent so developers know how to build integrations, handle failures and debug production issues.

Request schema

Define required fields, optional fields, store context, customer context, feature keys and validation rules.

{ "store_id": 1, "customer_id": 25, "feature": "ai_search", "input": {} }

Success response

Return normalized output, usage details, module metadata, provider details and trace identifiers.

{ "success": true, "result": {}, "usage": { "credits": 120, "provider": "openai" }, "trace_id": "api_abc123" }

Error response

Use predictable error codes for authentication, quota, validation, provider failures and permission issues.

{ "success": false, "error": { "code": "quota_exceeded", "message": "AI quota has been exceeded." }, "trace_id": "api_err_123" }
API topics

Quick links for common API documentation needs

Use these topic cards to build deeper documentation pages for each technical concern.

AuthenticationBearer tokens, Magento integration tokens, admin ACL, customer context and secret storage.Open topic
Rate limitsProtect AI providers, quota usage, API calls, search requests and webhook receivers.Open topic
IdempotencyUse idempotency keys for retries, billing events, plan changes and license operations.Open topic
PaginationDocument page size, cursors, filters, sorting and collection response metadata.Open topic
WebhooksValidate signatures, process events asynchronously, retry safely and log event status.Open topic
VersioningTrack API versions, deprecated fields, compatibility changes and migration timelines.Open topic
Security and production readiness

Build API integrations that are safe for Magento production stores

Document security expectations clearly before allowing integrations to access customer, order, payment, subscription or AI provider data.

Security checklist

API security requirements

Use this checklist to harden API integrations before production launch.

  • Store API keys outside version control
  • Use least-privilege admin ACL roles
  • Validate webhook signatures
  • Do not expose provider secrets in frontend code
  • Log trace IDs without logging sensitive payloads
  • Rotate credentials after incidents or staff changes
Error handling

Production error strategy

Make API failures recoverable and visible to developers without breaking customer journeys.

  • Return stable error codes
  • Use retry-safe operations
  • Queue webhook processing when possible
  • Add fallback behavior for AI provider failures
  • Expose admin logs and trace IDs
  • Alert on quota, payment and license failures
Support and implementation

Move from API documentation to real integration work

Use these support cards to guide developers and merchants to the right next action.

API implementation support

Get help connecting MageHQ APIs to Magento, ERP, CRM, SaaS platforms or custom applications.

Contact MageHQ

Custom API development

Create custom endpoints, service contracts, webhooks, admin tools and integration workflows for your store.

Start development

API maintenance

Keep integrations stable with monitoring, release notes, version updates, compatibility checks and troubleshooting.

View maintenance

Need help designing or documenting a MageHQ API?

Tell MageHQ what you need to connect: AI Commerce OS, AI modules, subscriptions, licenses, payments, plan downloads, customer access, webhooks or external systems. We will help you define the right API documentation and implementation roadmap.