Skip to content

Plugin API

The Plugin API allows WooCommerce and Shopify stores to generate product descriptions and blog posts directly from your e-commerce platform, without logging into the XC Scribe web application. Content is generated on demand and billed against your organization's XCT balance.

Getting an API Key

API keys are managed in the Settings page under the API Keys section (available to organization admins).

  1. Navigate to Settings > API Keys.
  2. Click Create API Key and give it a name (e.g., "WooCommerce Plugin").
  3. Copy the generated key immediately -- it will not be shown again.

All API keys use the xc_ prefix (e.g., xc_a1b2c3d4e5f6...). Each key is tied to your organization.

Authentication

Every request to the Plugin API must include your API key in the Authorization header as a Bearer token:

Authorization: Bearer xc_your_api_key_here

Requests without credentials receive a 403 Forbidden response. Invalid or inactive API keys receive a 401 Unauthorized response.

Endpoints

All endpoints are under /api/v1/plugin/.

Check Status

Verify that your API key is valid and check your current balance.

Endpoint: GET /api/v1/plugin/status

Example:

bash
curl https://api.xcscribe.com/api/v1/plugin/status \
  -H "Authorization: Bearer xc_your_api_key_here"

Response:

json
{
  "plan_tier": "free",
  "total_balance": "50.0000",
  "active_integrations": ["woocommerce"]
}
FieldTypeDescription
plan_tierstringYour subscription tier (free, starter, pro, etc.)
total_balancestringRemaining XCT balance
active_integrationsstring[]Integration types with active plugin projects

Generate Product Description

Generate an AI-powered product description for a single product.

Endpoint: POST /api/v1/plugin/generate-description

Request body:

FieldTypeRequiredDescription
sourcestringYesIntegration type: woocommerce or shopify
product_titlestringYesThe product name
product_categorystringNoProduct category
product_attributesobjectNoProduct attributes (size, color, material, etc.)
product_imagesstring[]NoList of product image URLs
current_descriptionstringNoExisting description to improve upon
languagestringNoTarget language code (default: en)
tonestringNoWriting tone (default: professional)
custom_instructionsstringNoAdditional instructions for the AI

Example:

bash
curl -X POST https://api.xcscribe.com/api/v1/plugin/generate-description \
  -H "Authorization: Bearer xc_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "woocommerce",
    "product_title": "Organic Cotton T-Shirt",
    "product_category": "Clothing",
    "product_attributes": {
      "material": "100% organic cotton",
      "sizes": "S, M, L, XL"
    },
    "language": "en",
    "tone": "professional"
  }'

Response:

json
{
  "content": "Crafted from 100% certified organic cotton, this premium t-shirt...",
  "tokens_used": 350,
  "xct_cost": "1.0500",
  "remaining_balance": "48.9500"
}
FieldTypeDescription
contentstringThe generated product description
tokens_usedintTotal AI tokens consumed
xct_coststringXCT deducted for this generation
remaining_balancestringYour remaining XCT balance

Generate Blog Post

Generate a blog post related to your products or store.

Endpoint: POST /api/v1/plugin/generate-blog

Request body:

FieldTypeRequiredDescription
sourcestringYesIntegration type: woocommerce or shopify
topicstringYesThe blog post topic or title
product_titlestringNoRelated product for context
product_categorystringNoRelated product category for context
languagestringNoTarget language code (default: en)
tonestringNoWriting tone (default: professional)
custom_instructionsstringNoAdditional instructions for the AI

Example:

bash
curl -X POST https://api.xcscribe.com/api/v1/plugin/generate-blog \
  -H "Authorization: Bearer xc_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "woocommerce",
    "topic": "5 Benefits of Organic Cotton Clothing",
    "product_title": "Organic Cotton T-Shirt",
    "product_category": "Clothing",
    "language": "en",
    "tone": "conversational"
  }'

Response:

json
{
  "content": "# 5 Benefits of Organic Cotton Clothing\n\nOrganic cotton is more than...",
  "tokens_used": 820,
  "xct_cost": "2.4600",
  "remaining_balance": "46.4900"
}

The response format is the same as the generate-description endpoint.

Billing

All plugin-generated content is billed in XCT (XC Tokens) against your organization's balance. The cost depends on the AI model tier and the length of the generated content.

  • Free accounts use Claude Sonnet 4.5 at the PREMIUM tier rate.
  • If your balance is insufficient, the API returns a 402 Payment Required response.
  • Check your remaining balance at any time with the GET /api/v1/plugin/status endpoint.
  • Top up your balance or upgrade your plan at app.xcscribe.com/settings/billing.

For more details on how XCT billing works, see Billing & Usage.

Error Responses

StatusDescription
401Invalid or inactive API key
402Insufficient XCT balance or subscription expired
403No credentials provided
422Invalid request body (missing required fields)
429Rate limit exceeded
500Internal server error

XC AI Content Automation