Authentication

The CTCGX API uses API keys to authenticate requests. You can create and manage API keys from your store dashboard.

Creating API Keys

To create an API key:

  1. Go to your Store Dashboard
  2. Navigate to Settings → API Keys
  3. Click Create API Key
  4. Give your key a name and select write permissions (if needed)
  5. Choose between Live or Test mode
  6. Copy the key immediately - it won't be shown again

Using Your API Key

Include your API key in the Authorization header with all requests:

curl https://api.ctcgx.com/api/v1/inventory \
  -H "Authorization: Bearer ctcgx_sk_live_xxxxxxxxxxxx"

Alternatively, you can use the X-API-Key header:

curl https://api.ctcgx.com/api/v1/inventory \
  -H "X-API-Key: ctcgx_sk_live_xxxxxxxxxxxx"

API Key Format

CTCGX API keys follow a predictable format:

LiveProduction Keys
ctcgx_sk_live_...

Creates real listings visible to customers

TestSandbox Keys
ctcgx_sk_test_...

Creates test data that's isolated from production

Permissions

All API keys have read access to inventory, orders, products, and sets. Write permissions must be explicitly granted when creating the key.

PermissionDescription
inventory:writeCreate, update, and delete inventory listings
orders:writeUpdate order status (mark shipped, etc.)

Test Mode

Test API keys allow you to safely develop and test your integration without affecting your live store.

Test Mode Behavior

  • Inventory created with test keys is marked as test data
  • Test listings are not visible to customers
  • Test data is completely isolated from production
  • You can delete all test data at any time from the dashboard

Security Best Practices

Keep Keys Secret

Never expose API keys in client-side code, public repositories, or logs. Use environment variables to store keys.

Use Minimal Permissions

Only grant write permissions your integration actually needs. If you only need to read data, you don't need any special permissions.

Rotate Keys Regularly

Periodically rotate your API keys. You can create a new key and revoke the old one from the dashboard.

Set Expiration Dates

When creating API keys, you can set an expiration date. This is useful for temporary integrations or contractors.

API Playground

Select an endpoint from the documentation to try it out here.