Build with Portmii Connect.

Check licenses from your own server. Read the customer, Discord and Telegram accounts linked to a license key, and store your own metadata on it.

Every request identifies the license with the key your customer gives you. Responses are JSON. Example values on this page are placeholders, not real customers.

Connect v1JSON over HTTPSServer to server
Base URL
https://api.portmii.com/connect/api/v1

Append the endpoint path, for example /license.

GET/license

Two headers on every request.

Authorization carries your API key as is, without a Bearer prefix. x-license-key carries the license key of the customer you are asking about.

Reading a license accepts your public or secret key. Changing metadata and unlinking Discord require the secret key.

Secret key

Authorization: sk_…

Full access. Keep it in server configuration and never ship it to a browser or app.

License key

x-license-key: <license-key>

The key your customer received after purchase. It selects the license for this request.

Retrieve license information

#
GET/licensePublic or secret key

Read a customer’s license: its status, your metadata and, on request, the linked customer, Discord and Telegram accounts.

Authorizationheader · required

Your public or secret key.

x-license-keyheader · required

The customer’s license key.

extendquery · array · optional

Adds linked records to the response:

CUSTOMERDISCORDTELEGRAM

Possible errors: 400 Invalid request, 404 Not found, 500 Server error.

Retrieve license information request
set -euo pipefail
: "${PORTMII_PUBLIC_KEY:?Set PORTMII_PUBLIC_KEY}" "${PORTMII_LICENSE_KEY:?Set PORTMII_LICENSE_KEY}"

printf 'Authorization: %s\nx-license-key: %s\n' "$PORTMII_PUBLIC_KEY" "$PORTMII_LICENSE_KEY" |
  curl -q --fail-with-body --silent --show-error --header @- \
  --request GET \
  "https://api.portmii.com/connect/api/v1/license?extend=CUSTOMER"
200 OKExample response
Retrieve license information response
{
  "metadata": {
    "plan": "pro"
  },
  "status": "<status>",
  "createdAt": "2026-10-01T12:00:00.000Z",
  "customer": {
    "email": "user@example.com",
    "name": "Sample Customer"
  },
  "discordClient": {
    "username": "sample_user",
    "discordUserId": "000000000000000000",
    "avatar": "<avatar>"
  },
  "telegramClient": {
    "username": "sample_user",
    "telegramUserId": "000000000",
    "avatar": "<avatar>"
  }
}

Set custom metadata

#
PUT/license/metadataSecret key

Store your own JSON object on a license, such as a plan name or an internal account ID.

Authorizationheader · required

Your secret key, sk_…

x-license-keyheader · required

The customer’s license key.

metadatabody · object

The JSON object to store on the license. It is returned as metadata when you read the license.

Possible errors: 400 Invalid request, 401 Authentication failed, 404 Not found, 500 Server error.

Set custom metadata request
set -euo pipefail
: "${PORTMII_SECRET_KEY:?Set PORTMII_SECRET_KEY}" "${PORTMII_LICENSE_KEY:?Set PORTMII_LICENSE_KEY}"

printf 'Authorization: %s\nx-license-key: %s\n' "$PORTMII_SECRET_KEY" "$PORTMII_LICENSE_KEY" |
  curl -q --fail-with-body --silent --show-error --header @- \
  --header 'Content-Type: application/json' \
  --data '{"metadata":{"plan":"pro"}}' \
  --request PUT \
  "https://api.portmii.com/connect/api/v1/license/metadata"
200 OKExample response
Set custom metadata response
{
  "message": "OK",
  "data": "<result>",
  "timestamp": "2026-10-25T09:30:00.000Z"
}

One error shape.

Failed requests return statusCode, errorCode, title and message. Use errorCode in your application logic.

Error response
{
  "statusCode": 404,
  "errorCode": "NOT_FOUND",
  "title": "Not found",
  "message": "The requested Resource was not found"
}
400Invalid request

The Request you sent was not formatted correctly.

VALIDATION_ERROR
401Authentication failed

Check your API Key and ensure it has the correct rights.

UNAUTHORIZED
404Not found

The requested Resource was not found.

NOT_FOUND
500Server error

Something went wrong in Portmii, try again later or contact support.

INTERNAL_SERVER_ERROR

Selling access with Connect?

Set up products, Stripe checkout and Discord or Telegram access in Portmii Connect.

Explore Connect