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:
- Go to your Store Dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Give your key a name and select write permissions (if needed)
- Choose between Live or Test mode
- 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:
ctcgx_sk_live_...Creates real listings visible to customers
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.
| Permission | Description |
|---|---|
inventory:write | Create, update, and delete inventory listings |
orders:write | Update 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
Never expose API keys in client-side code, public repositories, or logs. Use environment variables to store keys.
Only grant write permissions your integration actually needs. If you only need to read data, you don't need any special permissions.
Periodically rotate your API keys. You can create a new key and revoke the old one from the dashboard.
When creating API keys, you can set an expiration date. This is useful for temporary integrations or contractors.