SellGate API

Authentication

Learn how to authenticate with the SellGate API using API keys

Authentication

The SellGate API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard Settings.

Getting Your API Key

Open API Settings

Navigate to SettingsAPI

Generate Your Key

Click Generate API Key and copy your new key immediately

Store Securely

Save your API key in a secure location - you won't be able to see it again!

Your API key grants full access to your store data. Keep it secure and never expose it in client-side code or public repositories.

Using Your API Key

Include your API key in the Authorization header of every request:

curl -X GET "https://api.sellgate.cc/v1/products" \
  -H "Authorization: Bearer sg_live_your_api_key_here" \
  -H "Content-Type: application/json"
const response = await fetch('https://api.sellgate.cc/v1/products', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer sg_live_your_api_key_here',
    'Content-Type': 'application/json'
  }
});

const data = await response.json();
console.log(data);
import requests

headers = {
    'Authorization': 'Bearer sg_live_your_api_key_here',
    'Content-Type': 'application/json'
}

response = requests.get('https://api.sellgate.cc/v1/products', headers=headers)
data = response.json()
print(data)

API Key Format

SellGate API keys follow this format:

sg_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • sg_ - SellGate prefix
  • live_ - Production environment indicator
  • xxx... - 32-character random string

Supported Authorization Formats

Both formats are accepted:

# With Bearer prefix (recommended)
Authorization: Bearer sg_live_your_api_key

# Direct key
Authorization: sg_live_your_api_key

Security Best Practices

Environment Variables

Store API keys in environment variables, never hardcode them

Server-Side Only

Only use API keys in server-side code, never in browsers

Rotate Regularly

Regenerate your API key periodically for enhanced security

Monitor Usage

Keep an eye on your API usage for suspicious activity

Error Responses

If authentication fails, you'll receive a 401 Unauthorized response:

{
  "error": "Invalid or missing API key"
}

Prop

Type

Rate Limiting

The API is rate limited to 100 requests per minute per API key. Rate limit information is included in response headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window (100)
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetSeconds until the rate limit resets

If you exceed the rate limit, you'll receive a 429 Too Many Requests response:

{
  "error": "Rate limit exceeded. Maximum 100 requests per minute."
}

If you need higher rate limits for your integration, please contact our support team.

Pagination

All list endpoints support pagination with these query parameters:

ParameterTypeDefaultMaxDescription
pageinteger1-Page number
limitinteger25100Items per page

Response metadata includes:

{
  "data": [...],
  "meta": {
    "total": 150,
    "limit": 25,
    "offset": 0
  }
}

On this page