# Item updates (Toolkit)

Let a WordPress site keep the themes and plugins it bought here up to date. Tell us which packages are installed, get back the ones with a newer version, then pull the installable ZIP. This is what the SellMyCode Toolkit plugin uses — you only need these endpoints if you are building your own updater.

> **Note:** Requires a token with the `updates:read` permission. Updates are served while the update-support period of your purchase is still running; after it ends we still tell you a newer version exists, but the file is no longer available until you renew.

> **Tip:** On WordPress? Skip the code. The Toolkit plugin already wires these endpoints into the normal Themes and Plugins update screens. Install it, paste a token, and purchased items update like anything else in WordPress. [Download the plugin](https://sellmycode.net/toolkit/download) · [Installation guide](https://sellmycode.net/toolkit)

## Check for updates

`POST /api/updates/check`

| Parameter | Type | Description |
|---|---|---|
| `packages` | array | installed packages, up to 100 per call |
| `packages[].slug` | string | the theme or plugin folder name |
| `packages[].type` | string | theme \| plugin |
| `packages[].version` | string | the version currently installed (optional) |
```bash
curl "https://sellmycode.net/api/updates/check" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"packages":[{"slug":"my-theme","type":"theme","version":"1.4.0"}]}'
```
```json
{
  "status": "success",
  "checked": 1,
  "updates": [
    {
      "item_id": 123,
      "slug": "my-theme",
      "type": "theme",
      "name": "My Theme",
      "installed_version": "1.4.0",
      "new_version": "1.6.2",
      "changelog": { "version": "1.6.2", "body": "Fixed ..." },
      "can_download": true,
      "reason": null,
      "update_window_ends_at": "2027-01-30T10:00:00+00:00",
      "download_url": "https://sellmycode.net/api/updates/download/123",
      "renew_url": null
    }
  ]
}
```
> **Note:** Only items you actually bought are returned — anything else installed on the site is ignored, so it is safe to send your whole plugin list.

## Download the installable package

`GET /api/updates/download/{id}`

Responds with a 302 redirect to a short-lived storage URL (valid a few minutes). Follow redirects and save the ZIP — it contains only the theme or plugin, ready to install.

```bash
curl -L -o update.zip "https://sellmycode.net/api/updates/download/123" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

| Error code | HTTP | Meaning |
|---|---|---|
| `not_purchased` | 403 | this account did not buy the item |
| `update_window_expired` | 403 | update support has ended — renew_url is included in the response |
| `no_installable_file` | 404 | the author has not provided an installable package for this item |
| `item_removed` | 410 | the item is no longer available |

> **Warning:** These endpoints are limited to 60 requests per minute. A site normally needs only a few calls per day — check once, then download what changed.

---
Source: https://sellmycode.net/api-docs/item-updates
