comecerodocs

Import license keys

POST
/license_services/{license_service_id}/imports

Import existing keys and devices into a generated service. Secret and trusted tokens need licenses:create and read access to the service, customers and products. Limited tokens cannot import. The token sets Test or Live mode. Other service types return 409 license_import_service_conflict. Send 1 to 20 rows, at most 500 devices and a body of at most 1 MiB. Each key allows 90 devices; contact support for more. Unknown fields and duplicate JSON properties are refused. Dry run checks rows and saves a receipt without creating licenses or devices. Confirm with a new Idempotency-Key. Check every row in a 200 report: failed rows do not undo successful rows. Exact source duplicates return the existing license. Changed source data returns license_import_conflict. A key used by another license returns license_key_conflict, including across modes in one account. Re-import does not restore removed devices or old settings. Match Comecero customers and products first. Optional order_id and item_id must name a one-time line for the same customer and product, and need order read/update access. Import creates no payments, invoices or subscriptions and keeps the exact expiry. Wait for active_in_apollo before using devices. After an unknown result, read the receipt when its ID is known, then explicitly retry the same body and key. If no receipt ID was received, deliberately resend the same body and Idempotency-Key to recover or continue it. Requests are never retried automatically.

Authorization

headerAuthorizationBearer <token>

A secret, trusted or limited token. See Authentication.

Path Parameters

license_service_id*string

The resource id.

Header Parameters

Idempotency-Key*string

Send one printable ASCII key. Keep the body and key for retries. A changed body returns 409 idempotency_conflict; work still running returns 409 request_pending. Reuse requires the same account, mode, method, path, merchant scope and response options. Permissions are checked again. Saved requests do not expire.

Match^[\x20-\x7e]+$
Length1 <= length <= 128

Request Body

application/json
  1. body
dry_run*boolean

True checks rows and saves a receipt only. Confirmation needs a new key.

rows*array<>

At most 500 devices in total, and 90 per key. Maximum decoded request body is 1 MiB.

Items1 <= items <= 20

Response Body

A saved report with results and errors for each row. Full keys are hidden.

application/json
  1. response
object*string

The object type.

import_id*string

The saved receipt id.

Match^lim_[0-9a-f]{64}$
url*string

The receipt URL.

Formaturi
account_id*string

The owning account.

test*boolean

The authenticated mode.

date_created*string

When the request was saved.

Formatdate-time
date_modified*string

When progress last changed.

Formatdate-time
dry_run*boolean

Whether this was a dry run.

status*string

A completed import may still be preparing devices.

Value in"running""completed"
summary*
results*array<>
curl -X POST 'https://api.comecero.com/api/v1/license_services/string/imports' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "dry_run": true,  "rows": [    {      "row_id": "ls-42",      "license_key": "TEST-80e15db5-c796-436b-850c-8f9c98a48abe",      "customer_id": "customer_test",      "product_id": "widget-pro.test",      "order_id": null,      "item_id": null,      "status": "active",      "activation_limit": 3,      "activation_usage": 1,      "expires_at": null,      "over_limit": "rotate",      "external": {        "provider": "lemon_squeezy",        "store_id": "10",        "license_key_id": "42",        "customer_id": "15",        "order_id": "20",        "order_item_id": "21",        "product_id": "30",        "variant_id": null,        "subscription_id": null,        "created_at": "2024-05-24T14:15:07Z"      },      "instances": [        {          "instance_id": "f70a79fa-6054-433e-9c1b-6075344292e4",          "name": "Existing laptop",          "activated_at": "2024-05-24T14:15:07Z"        }      ]    }  ]}'
Example Response
{  "object": "license_import",  "import_id": "lim_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "url": "https://api.comecero.com/api/v1/license_services/ls_test/imports/lim_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "account_id": "AB1234",  "test": true,  "date_created": "2026-12-03T10:00:00Z",  "date_modified": "2026-12-03T10:00:01Z",  "dry_run": true,  "status": "completed",  "summary": {    "imported": 0,    "valid": 1,    "duplicate": 0,    "error": 0  },  "results": [    {      "index": 0,      "row_id": "ls-42",      "result": "valid",      "license_id": null,      "license": null,      "key_last4": "8ABE",      "imported_activations": 1,      "error": null    }  ]}