> For the complete documentation index, see [llms.txt](https://docs.rtkdata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rtkdata.com/reseller-hub/api/api-v1.md). Agents can also search and read this documentation through its [MCP server](https://docs.rtkdata.com/~gitbook/mcp).

# API v1: Simple Shop Integration

API v1 for simple shop integrations: provision a license at checkout, update, renew, suspend, reactivate and cancel it with eight idempotent calls.

**API v1** is the simple shop integration: a handful of calls around one license. Your shop provisions a license at checkout, gets the credentials back in the same answer, and keeps the license in step with the customer's subscription. For anything beyond that, customers, bills, events and connections, see [API v2](https://docs.rtkdata.com/reseller-hub/api/v2.md).

Keys, environments, webhooks and the request history are the same for both versions and are described on the [API](https://docs.rtkdata.com/reseller-hub/api.md) page.

***

## The endpoints

The base URL is `https://reseller.rtkdata.com/v1`. Every call takes your key as a bearer token: `Authorization: Bearer rtk_test_...`.

| Endpoint                         | Purpose                                                                                                                                               |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST /provision`                | Creates a license (or a trial) for a customer and returns their credentials                                                                           |
| `GET /licenses/{id}`             | Reads a license as it is now, including its credentials                                                                                               |
| `POST /licenses/{id}/update`     | Adds data streams or lengthens the term of a paid license. Values can only go up. On a trial, converts it to a paid license                           |
| `POST /licenses/{id}/renew`      | Renews a paid license for one more term of its current length, for example when the customer pays for another month                                   |
| `POST /licenses/{id}/suspend`    | Stops the credentials working, for example on a chargeback. Also switches auto renew off                                                              |
| `POST /licenses/{id}/reactivate` | Resumes a suspended license. Auto renew comes back if it was on before and the term has not run out                                                   |
| `POST /licenses/{id}/cancel`     | Stops the license from renewing by switching auto renew off. It keeps working until its end date, then expires. To cut access immediately, suspend it |
| `POST /licenses/{id}/auto-renew` | Switches auto renew on: at its end date the license renews for another term of the same length. Only for a running paid license                       |

***

## Provisioning

```bash
curl -X POST https://reseller.rtkdata.com/v1/provision \
  -H "Authorization: Bearer rtk_test_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-4821" \
  -d '{
    "customerName": "Jane Doe",
    "customerEmail": "buyer@example.com",
    "customerReference": "shop-customer-1187",
    "product": "ntrip_license",
    "seats": 1,
    "term": "annual",
    "termAmount": 1
  }'
```

| Field                           | Meaning                                                                                                                                                                       |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `customerName`, `customerEmail` | At least one is required. The customer is found by email, then by `customerReference`, then (only if you sent neither) by name, and created if none matches                   |
| `customerReference`             | Optional. Your shop's own customer id, not the order number                                                                                                                   |
| `product`                       | `ntrip_license` (paid) or `ntrip_demo` (trial)                                                                                                                                |
| `seats`                         | Data streams, 1 to 999, default 1                                                                                                                                             |
| `term`, `termAmount`            | `term` is `monthly` or `annual`, `termAmount` how many of it: 1 to 11 months, or 1 to 5 years. `termAmount` defaults to 1, and a license ordered without a term runs one year |
| `termMonths`                    | The older way to send the term (1 to 11, or 12, 24, 36, 48 or 60). Still accepted in place of `term` and `termAmount`, but not together with them                             |
| `trialDurationDays`             | For a trial: 7, 14 or 30, default 30. A trial always has one data stream, and each customer gets one trial, ever. `seats` and the term are ignored for a trial                |

A paid license starts with auto renew **off**. Switch it on with `POST /licenses/{id}/auto-renew`.

The response carries the license and its credentials (host, username, password, the default mountpoint and every mountpoint the login works on). Credentials are read live from the caster; if they cannot be read at that moment they come back as `null`, and a `GET /licenses/{id}` a little later returns them.

Every answer names the term both ways, as `term` and `termAmount` and as `termMonths`. A trial has no term: its answer carries `trialDurationDays`, and the three term fields are `null`. A paid license answers the other way round, with its term and `trialDurationDays` as `null`.

The API does not email your customer. Deliver the credentials in your own order confirmation, or send them a [customer portal](https://docs.rtkdata.com/reseller-hub/customer-portal.md) login link from the Reseller Hub.

***

## Lifecycle changes

A lifecycle change looks like this:

```bash
curl -X POST https://reseller.rtkdata.com/v1/licenses/lic_8f2a91/suspend \
  -H "Authorization: Bearer rtk_test_xxxxxxxxxxxx" \
  -H "Idempotency-Key: suspend-8f2a91"
```

**Update** takes `seats`, a term (`term` and `termAmount`, as in provisioning) or both. On a paid license both can only go up: more streams, or a longer term. Extra streams are billed pro rata for the paid time left, a longer term starts when the current one ends, and both appear on your next monthly bill. On a trial, one update converts it to a paid license: send both `seats` and the term the customer bought. The login stays the same and the paid term starts now. An update with only `seats` or only a term on a trial returns 400.

**Renew** takes no body and adds one more term of the license's current length: a monthly license moves one month on, a two year license two years. Renewed before the end date, the new term starts there and no paid time is lost; renewed after the license ran out, it starts now. Only a paid license that is active or has run out can be renewed: convert a trial with update, and reactivate a suspended license first. Each `Idempotency-Key` renews once, so use a new key for each renewal.

***

## Idempotency

Every call that changes something **requires** an `Idempotency-Key` header (up to 200 characters). Use something stable from your own system, your order number is ideal. Keys are yours alone: another account using the same key does not affect you.

Sending the same request with the same key again returns the license as it is now instead of doing it twice. That matters more than it sounds: a timeout on your side, a shopper double clicking checkout, or a retry in your queue would otherwise each cost a license and a line on your bill.

A key belongs to one request. Reusing it with a different body, action or license returns **409**, and so does a retry while the first request is still running. Use a new key for each new request. After a 5xx error, retry with the same key: a request that already went through is never repeated.

A 409 can also mean the customer already had a trial, or that your account does not allow new licenses right now, for example while a bill is overdue. The response body says which.

***

## Errors and webhooks

**API > Docs** in the portal lists the v1 error responses (400, 401, 403, 404, 409 and 5xx) and what each one means.

The eight events a v1 integration subscribes to are `license.activated`, `license.updated`, `license.suspended`, `license.reactivated`, `license.cancelled`, `license.renewed`, `license.expiring` and `license.expired`. How endpoints, signatures and retries work is on the [API](https://docs.rtkdata.com/reseller-hub/api.md#webhooks) page.

> **Coming from the previous RTKdata reseller portal?** Its `/api/v1` endpoints keep working for existing integrations. New integrations should use v2, or v1 as described here.

***

## Next

* [API](https://docs.rtkdata.com/reseller-hub/api.md) - keys, webhooks, request history and which version to pick
* [API v2](https://docs.rtkdata.com/reseller-hub/api/v2.md) - the deeper integration, and what changes when you move from v1
* [Licenses & Provisioning](https://docs.rtkdata.com/reseller-hub/licenses.md) - the same lifecycle, done by hand


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rtkdata.com/reseller-hub/api/api-v1.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
