API Documentation
Integrate your applications with the marketplace: read your account and items, pull your sales for custom dashboards, and verify buyer purchase codes from your own license server.
curl https://sellmycode.net/api
Authentication
Every request needs a personal access token. Create named, scoped tokens in your workspace under Settings → API Key — each app gets its own token with only the permissions it needs, and you can revoke any of them at any time.
curl https://sellmycode.net/api/account/details \ -H "Authorization: Bearer YOUR_API_KEY"
curl https://sellmycode.net/api/account/details \ -H "X-Api-Key: YOUR_API_KEY"
Errors & Limits
| Code | Meaning |
|---|---|
| 200 | success |
| 400 | Validation error — a required parameter is missing or malformed |
| 401 | Invalid or missing API key |
| 404 | Resource not found (also returned for an invalid purchase code) |
| 429 | Rate limit exceeded — wait and retry (60 requests per minute) |
{
"status": "error",
"msg": "Invalid request"
}
GETAccount Details
Returns the profile of the account that owns the API key.
curl https://sellmycode.net/api/account/details \ -H "Authorization: Bearer YOUR_API_KEY"
GETAll Items
All of your approved items, newest first. Authors only.
curl https://sellmycode.net/api/items/all \ -H "Authorization: Bearer YOUR_API_KEY"
GETSingle Item
One of your approved items by its numeric ID.
| Parameter | Type | Description |
|---|---|---|
| item_id Required | integer | The item ID (shown in your workspace item list) |
curl "https://sellmycode.net/api/items/item?item_id=123" \ -H "Authorization: Bearer YOUR_API_KEY"
GETSales
Your sales, newest first — build revenue dashboards or sync orders into your own tools. Paginated.
| Parameter | Type | Description |
|---|---|---|
| from optional | date | Y-m-d — only sales on or after this date |
| to optional | date | Y-m-d — only sales on or before this date |
| item_id optional | integer | filter by one of your items |
| status optional | string | active | refunded | cancelled | held |
| per_page optional | integer | default 25, max 50 |
| page optional | integer | page number |
curl "https://sellmycode.net/api/sales?from=2026-01-01&status=active&per_page=25" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"status": "success",
"pagination": { "page": 1, "per_page": 25, "total": 132, "last_page": 6 },
"sales": [
{
"id": 981,
"purchase_code": "8f14e45f-ce95-41d8-a2b6-72e5f13d81a7",
"item": { "id": 123, "name": "My Theme" },
"buyer": "johndoe",
"license_type": "Regular",
"price": 29.0,
"fee": 5.8,
"earning": 23.2,
"currency": "USD",
"sale_status": "active",
"cleared": true,
"date": "2026-07-01T09:30:00+00:00"
}
]
}
POSTPurchase Validation
Verify a purchase code a buyer gives you — the core of any license system. Returns the purchase details when the code belongs to one of YOUR items and is still active; otherwise 404.
| Parameter | Type | Description |
|---|---|---|
| purchase_code Required | string | The code from the buyer (shown on their Purchases page and license certificate) |
curl -X POST https://sellmycode.net/api/purchases/validation \ -H "Authorization: Bearer YOUR_API_KEY" \ -d "purchase_code=BUYER_PURCHASE_CODE"
// license check from your app / plugin $ch = curl_init('https://sellmycode.net/api/purchases/validation'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'], CURLOPT_POSTFIELDS => http_build_query(['purchase_code' => $code]), ]); $res = json_decode(curl_exec($ch), true); $valid = ($res['status'] ?? '') === 'success';
// Node.js 18+ (built-in fetch) const res = await fetch('https://sellmycode.net/api/purchases/validation', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ purchase_code: code }), }); const data = await res.json(); const valid = res.ok && data.status === 'success';
# Python 3 + requests import requests res = requests.post( 'https://sellmycode.net/api/purchases/validation', headers={'Authorization': 'Bearer YOUR_API_KEY'}, data={'purchase_code': code}, timeout=10, ) valid = res.status_code == 200 and res.json().get('status') == 'success'
{
"status": "success",
"buyer": "johndoe",
"item": {
"purchase_code": "8f14e45f-ce95-41d8-a2b6-72e5f13d81a7",
"license_type": "Regular",
"price": 29.0,
"currency": "USD",
"item": { "…item fields…" },
"supported_until": "2026-12-01T00:00:00+00:00",
"download_expiry": "2026-08-01T00:00:00+00:00",
"downloaded": true,
"date": "2026-07-01T09:30:00+00:00"
}
}