> For the complete documentation index, see [llms.txt](https://merithic.gitbook.io/merithic-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://merithic.gitbook.io/merithic-docs/api-reference/endpoints/check.md).

# POST /check

The simplest licensing call. Returns whether a player holds an active license.

```
POST https://api.merithic.com/check
```

## Request

| Field        | Type             | Required | Description                             |
| ------------ | ---------------- | -------- | --------------------------------------- |
| `user_id`    | string or number | yes      | The Roblox user ID of the player.       |
| `product_id` | string           | yes      | Your product's ID, from the dashboard.  |
| `key`        | string           | yes      | The buyer's license key.                |
| `game_id`    | string or number | no       | The place ID, recorded for your alerts. |

```json
{
  "user_id": "123456789",
  "product_id": "prod_abc123",
  "key": "the buyer's key",
  "game_id": "987654321"
}
```

## Response

```json
{ "success": true }
```

`success` is `false` when there's no license, it's paused, or the key doesn't match the one issued to that user. The endpoint always returns `200`; a `false` result is an answer, not an error.

{% hint style="danger" %}
**Do not gate anything valuable on this alone.** The response is a plain boolean, so anyone who can intercept the request can return `{ "success": true }` and walk straight past it.

Use [`/unlock`](/merithic-docs/api-reference/endpoints/unlock.md) for anything you actually care about protecting. `/check` is for cheap, non-critical checks like showing UI state.
{% endhint %}

## Examples

{% tabs %}
{% tab title="Luau (server)" %}

```lua
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")

local PRODUCT_ID = "prod_abc123"
local KEY = "the buyer's key"

local function isLicensed(userId: number): boolean
	local ok, res = pcall(function()
		return HttpService:PostAsync(
			"https://api.merithic.com/check",
			HttpService:JSONEncode({
				user_id = tostring(userId),
				product_id = PRODUCT_ID,
				key = KEY,
				game_id = tostring(game.PlaceId),
			}),
			Enum.HttpContentType.ApplicationJson
		)
	end)

	if not ok then
		-- Network failure. Decide deliberately: this fails CLOSED.
		return false
	end

	local body = HttpService:JSONDecode(res)
	return body.success == true
end

Players.PlayerAdded:Connect(function(player)
	if not isLicensed(player.UserId) then
		warn(("%s is not licensed"):format(player.Name))
	end
end)
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
async function isLicensed(userId) {
  const res = await fetch("https://api.merithic.com/check", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      user_id: String(userId),
      product_id: "prod_abc123",
      key: process.env.UPDATR_KEY,
    }),
  });

  if (!res.ok) throw new Error(`check failed: ${res.status}`);
  const { success } = await res.json();
  return success === true;
}
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST https://api.merithic.com/check \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "123456789",
    "product_id": "prod_abc123",
    "key": "the buyers key"
  }'
```

{% endtab %}
{% endtabs %}

## What the seller sees

If a key is used under a **different** user ID than the one it was issued to, the call fails and a **leaked key** alert appears on the seller's dashboard. That's how key sharing gets caught, so don't reuse one key across accounts while testing.

## See also

{% content-ref url="/pages/s4HsRum87vgVH4KC5lHW" %}
[POST /unlock](/merithic-docs/api-reference/endpoints/unlock.md)
{% endcontent-ref %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://merithic.gitbook.io/merithic-docs/api-reference/endpoints/check.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
