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.

Base URL: https://sellmycode.net/api Format: JSON Rate limit: 60 req/min
Quick check
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.

account:read items:read sales:read purchases:validate
Send the key in the Authorization header (recommended). The api_key query parameter is also accepted for backwards compatibility, but keys in URLs can leak into logs.
Recommended — Authorization header
curl https://sellmycode.net/api/account/details \
  -H "Authorization: Bearer YOUR_API_KEY"
Alternative — X-Api-Key header
curl https://sellmycode.net/api/account/details \
  -H "X-Api-Key: YOUR_API_KEY"

Errors & Limits

CodeMeaning
200success
400Validation error — a required parameter is missing or malformed
401Invalid or missing API key
404Resource not found (also returned for an invalid purchase code)
429Rate limit exceeded — wait and retry (60 requests per minute)
Error shape
{
  "status": "error",
  "msg": "Invalid request"
}

GETAccount Details

Returns the profile of the account that owns the API key.

GET/api/account/details
Request
curl https://sellmycode.net/api/account/details \
  -H "Authorization: Bearer YOUR_API_KEY"

GETAll Items

All of your approved items, newest first. Authors only.

GET/api/items/all
Request
curl https://sellmycode.net/api/items/all \
  -H "Authorization: Bearer YOUR_API_KEY"

GETSingle Item

One of your approved items by its numeric ID.

GET/api/items/item?item_id={id}
ParameterTypeDescription
item_id RequiredintegerThe item ID (shown in your workspace item list)
Request
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.

GET/api/sales
ParameterTypeDescription
from optionaldateY-m-d — only sales on or after this date
to optionaldateY-m-d — only sales on or before this date
item_id optionalintegerfilter by one of your items
status optionalstringactive | refunded | cancelled | held
per_page optionalintegerdefault 25, max 50
page optionalintegerpage number
Request
curl "https://sellmycode.net/api/sales?from=2026-01-01&status=active&per_page=25" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response 200
{
  "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.

POST/api/purchases/validation
ParameterTypeDescription
purchase_code RequiredstringThe 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'
Response 200
{
  "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"
  }
}
A 404 is returned for BOTH an unknown code and a refunded/blocked purchase — treat any non-200 as "license invalid".