# Import license keys (/api/licenses/import-licenses)

`POST https://api.comecero.com/api/v1/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.

## Request parameters

### license_service_id (path, required)

The resource id.

```json
{
  "type": "string"
}
```

### Idempotency-Key (header, required)

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.

```json
{
  "type": "string",
  "minLength": 1,
  "maxLength": 128,
  "pattern": "^[\\x20-\\x7e]+$"
}
```

## Request body (required)

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "license_import_request",
  "additionalProperties": false,
  "required": [
    "dry_run",
    "rows"
  ],
  "properties": {
    "dry_run": {
      "type": "boolean",
      "description": "True checks rows and saves a receipt only. Confirmation needs a new key."
    },
    "rows": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "type": "object",
        "title": "license_import_row",
        "additionalProperties": false,
        "required": [
          "row_id",
          "license_key",
          "customer_id",
          "product_id",
          "status",
          "activation_limit",
          "activation_usage",
          "expires_at",
          "external",
          "instances"
        ],
        "properties": {
          "row_id": {
            "type": "string",
            "description": "A unique caller reference within this batch.",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
          },
          "license_key": {
            "type": "string",
            "description": "The full key. At least 16 characters after spaces and dashes are removed.",
            "minLength": 16,
            "maxLength": 256,
            "pattern": "^[\\x20-\\x7e]+$"
          },
          "customer_id": {
            "type": "string",
            "description": "An existing Comecero customer id.",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
          },
          "product_id": {
            "type": "string",
            "description": "An existing Comecero digital or service product id.",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
          },
          "order_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "An existing one-time Comecero order id, if linked. Send with item_id.",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
          },
          "item_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Comecero order line. Send with order_id.",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
          },
          "status": {
            "type": "string",
            "description": "The key state. Expiry is checked separately.",
            "enum": [
              "active",
              "revoked"
            ]
          },
          "revoked_reason": {
            "type": "string",
            "description": "Use merchant for a disabled source key.",
            "const": "merchant"
          },
          "activation_limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The exact limit. Null is unlimited.",
            "minimum": 1,
            "maximum": 2147483647
          },
          "activation_usage": {
            "type": "integer",
            "minimum": 0,
            "description": "Must equal instances.length. More than 90 devices is a row error; contact support.",
            "maximum": 2147483647
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact expiry, or null for no expiry. Send seconds and a timezone (Z or ±HH:mm), with up to seven fractional digits.",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?(Z|[+-]\\d{2}:\\d{2})$"
          },
          "over_limit": {
            "type": "string",
            "description": "The key policy. Omit to copy the service policy.",
            "enum": [
              "block",
              "rotate"
            ]
          },
          "external": {
            "type": "object",
            "title": "license_import_external",
            "additionalProperties": false,
            "required": [
              "provider",
              "store_id",
              "license_key_id"
            ],
            "properties": {
              "provider": {
                "type": "string",
                "description": "The source provider.",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$",
                "example": "lemon_squeezy"
              },
              "store_id": {
                "type": "string",
                "description": "The source store id.",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "license_key_id": {
                "type": "string",
                "description": "The source key id.",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "customer_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "order_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "order_item_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "product_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "variant_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "subscription_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The source value. It does not name a Comecero record.",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
              }
            }
          },
          "instances": {
            "type": "array",
            "description": "All active source devices, including for revoked or expired keys. More than 90 is a row error.",
            "items": {
              "type": "object",
              "title": "license_import_instance",
              "additionalProperties": false,
              "required": [
                "instance_id",
                "name",
                "activated_at"
              ],
              "properties": {
                "instance_id": {
                  "type": "string",
                  "description": "The saved device identifier, kept exactly.",
                  "pattern": "^[A-Za-z0-9_.:-]{1,128}$"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The device name.",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[^\\x00-\\x1f\\x7f-\\x9f]+$"
                },
                "activated_at": {
                  "type": "string",
                  "description": "When the device was first activated. Send seconds and a timezone (Z or ±HH:mm), with up to seven fractional digits.",
                  "format": "date-time",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?(Z|[+-]\\d{2}:\\d{2})$"
                }
              }
            },
            "maxItems": 90
          }
        }
      },
      "description": "At most 500 devices in total, and 90 per key. Maximum decoded request body is 1 MiB."
    }
  },
  "example": {
    "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:

```json
{
  "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: Check one key

```json
{
  "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: Import one key with one failed row

```json
{
  "dry_run": false,
  "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"
        }
      ]
    },
    {
      "row_id": "ls-43",
      "license_key": "TEST-80e15db5-c796-436b-850c-000000000002",
      "customer_id": "customer_test",
      "product_id": "widget-pro.test",
      "order_id": null,
      "item_id": null,
      "status": "active",
      "activation_limit": 3,
      "activation_usage": 2,
      "expires_at": null,
      "over_limit": "rotate",
      "external": {
        "provider": "lemon_squeezy",
        "store_id": "10",
        "license_key_id": "43",
        "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"
        }
      ]
    }
  ]
}
```

## Response 200

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

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "license_import",
  "additionalProperties": false,
  "required": [
    "object",
    "import_id",
    "url",
    "account_id",
    "test",
    "date_created",
    "date_modified",
    "dry_run",
    "status",
    "summary",
    "results"
  ],
  "properties": {
    "object": {
      "type": "string",
      "description": "The object type.",
      "const": "license_import"
    },
    "import_id": {
      "type": "string",
      "description": "The saved receipt id.",
      "pattern": "^lim_[0-9a-f]{64}$"
    },
    "url": {
      "type": "string",
      "description": "The receipt URL.",
      "format": "uri"
    },
    "account_id": {
      "type": "string",
      "description": "The owning account."
    },
    "test": {
      "type": "boolean",
      "description": "The authenticated mode."
    },
    "date_created": {
      "type": "string",
      "description": "When the request was saved.",
      "format": "date-time"
    },
    "date_modified": {
      "type": "string",
      "description": "When progress last changed.",
      "format": "date-time"
    },
    "dry_run": {
      "type": "boolean",
      "description": "Whether this was a dry run."
    },
    "status": {
      "type": "string",
      "description": "A completed import may still be preparing devices.",
      "enum": [
        "running",
        "completed"
      ]
    },
    "summary": {
      "type": "object",
      "required": [
        "imported",
        "valid",
        "duplicate",
        "error"
      ],
      "properties": {
        "imported": {
          "type": "integer",
          "minimum": 0,
          "description": "The row count."
        },
        "valid": {
          "type": "integer",
          "minimum": 0,
          "description": "The row count."
        },
        "duplicate": {
          "type": "integer",
          "minimum": 0,
          "description": "The row count."
        },
        "error": {
          "type": "integer",
          "minimum": 0,
          "description": "The row count."
        }
      }
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "license_import_result",
        "additionalProperties": false,
        "required": [
          "index",
          "row_id",
          "result",
          "license_id",
          "license",
          "key_last4",
          "imported_activations",
          "error"
        ],
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "The zero-based row index."
          },
          "row_id": {
            "type": "string",
            "description": "The caller reference."
          },
          "result": {
            "type": "string",
            "description": "The row outcome. Valid is dry-run only.",
            "enum": [
              "pending",
              "valid",
              "imported",
              "duplicate",
              "error"
            ]
          },
          "license_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The saved license id, when known."
          },
          "license": {
            "type": [
              "string",
              "null"
            ],
            "description": "The saved license URL, when known.",
            "format": "uri"
          },
          "key_last4": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last four characters. Never the full key."
          },
          "imported_activations": {
            "type": "integer",
            "minimum": 0,
            "description": "The number of devices imported. This is not the current active count."
          },
          "error": {
            "oneOf": [
              {
                "type": "object",
                "title": "error_details",
                "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
                "required": [
                  "type",
                  "code",
                  "message",
                  "reference",
                  "status",
                  "meta"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The broad category. It matches `status`.",
                    "enum": [
                      "bad_request",
                      "invalid_request",
                      "unauthorized",
                      "transaction_error",
                      "forbidden",
                      "not_found",
                      "conflict",
                      "unprocessable",
                      "too_many_requests",
                      "internal_server_error",
                      "external_server_error",
                      "service_unavailable",
                      "external_server_timeout"
                    ]
                  },
                  "code": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
                    "examples": [
                      "invalid_input"
                    ]
                  },
                  "message": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
                  },
                  "reference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
                    "examples": [
                      "qh81SPw"
                    ]
                  },
                  "status": {
                    "type": "integer",
                    "description": "The HTTP status code of the response.",
                    "enum": [
                      400,
                      401,
                      402,
                      403,
                      404,
                      409,
                      413,
                      422,
                      429,
                      500,
                      502,
                      503,
                      504
                    ]
                  },
                  "meta": {
                    "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": true
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "description": "The row error, the same object as `error` in an error response. Null when the row worked."
          }
        }
      }
    }
  },
  "example": {
    "object": "license_import",
    "import_id": "lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "url": "https://api.comecero.com/api/v1/license_services/ls_test/imports/lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "account_id": "AB1234",
    "test": true,
    "date_created": "2026-12-03T10:00:00Z",
    "date_modified": "2026-12-03T10:00:01Z",
    "dry_run": false,
    "status": "completed",
    "summary": {
      "imported": 1,
      "valid": 0,
      "duplicate": 0,
      "error": 1
    },
    "results": [
      {
        "index": 0,
        "row_id": "ls-42",
        "result": "imported",
        "license_id": "license_test",
        "license": "https://api.comecero.com/api/v1/licenses/license_test",
        "key_last4": "8ABE",
        "imported_activations": 1,
        "error": null
      },
      {
        "index": 1,
        "row_id": "ls-43",
        "result": "error",
        "license_id": null,
        "license": null,
        "key_last4": null,
        "imported_activations": 0,
        "error": {
          "type": "invalid_request",
          "code": "license_import_invalid",
          "message": "The activation count does not match the supplied devices.",
          "reference": "LicenseImport",
          "status": 400,
          "meta": {
            "field": "rows[1].activation_usage"
          }
        }
      }
    ]
  }
}
```

Example:

```json
{
  "object": "license_import",
  "import_id": "lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "url": "https://api.comecero.com/api/v1/license_services/ls_test/imports/lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "account_id": "AB1234",
  "test": true,
  "date_created": "2026-12-03T10:00:00Z",
  "date_modified": "2026-12-03T10:00:01Z",
  "dry_run": false,
  "status": "completed",
  "summary": {
    "imported": 1,
    "valid": 0,
    "duplicate": 0,
    "error": 1
  },
  "results": [
    {
      "index": 0,
      "row_id": "ls-42",
      "result": "imported",
      "license_id": "license_test",
      "license": "https://api.comecero.com/api/v1/licenses/license_test",
      "key_last4": "8ABE",
      "imported_activations": 1,
      "error": null
    },
    {
      "index": 1,
      "row_id": "ls-43",
      "result": "error",
      "license_id": null,
      "license": null,
      "key_last4": null,
      "imported_activations": 0,
      "error": {
        "type": "invalid_request",
        "code": "license_import_invalid",
        "message": "The activation count does not match the supplied devices.",
        "reference": "LicenseImport",
        "status": 400,
        "meta": {
          "field": "rows[1].activation_usage"
        }
      }
    }
  ]
}
```

Example: One valid key, nothing imported

```json
{
  "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
    }
  ]
}
```

Example: One imported key and one failed row

```json
{
  "object": "license_import",
  "import_id": "lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "url": "https://api.comecero.com/api/v1/license_services/ls_test/imports/lim_bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "account_id": "AB1234",
  "test": true,
  "date_created": "2026-12-03T10:00:00Z",
  "date_modified": "2026-12-03T10:00:01Z",
  "dry_run": false,
  "status": "completed",
  "summary": {
    "imported": 1,
    "valid": 0,
    "duplicate": 0,
    "error": 1
  },
  "results": [
    {
      "index": 0,
      "row_id": "ls-42",
      "result": "imported",
      "license_id": "license_test",
      "license": "https://api.comecero.com/api/v1/licenses/license_test",
      "key_last4": "8ABE",
      "imported_activations": 1,
      "error": null
    },
    {
      "index": 1,
      "row_id": "ls-43",
      "result": "error",
      "license_id": null,
      "license": null,
      "key_last4": null,
      "imported_activations": 0,
      "error": {
        "type": "invalid_request",
        "code": "license_import_invalid",
        "message": "The activation count does not match the supplied devices.",
        "reference": "LicenseImport",
        "status": 400,
        "meta": {
          "field": "rows[1].activation_usage"
        }
      }
    }
  ]
}
```

## Response 400

Invalid input (type `bad_request`, usually code `invalid_input`). The message names the field or query parameter and why it was refused.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "bad_request",
    "code": "invalid_input",
    "message": "The value supplied for the url query string parameter 'limit' is invalid. The value must be between 1 and 100 or remove the parameter to use the default.",
    "reference": "2mJgF4F",
    "status": 400,
    "meta": null
  }
}
```

## Response 401

The token is missing, expired or not valid (type `unauthorized`, code `invalid_token`).

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "unauthorized",
    "code": "invalid_token",
    "message": "Authentication failed.",
    "reference": "pre3XcJ",
    "status": 401,
    "meta": null
  }
}
```

## Response 403

The token is valid but may not do this (type `forbidden`, code `insufficient_permissions`). For example a limited token on a route only secret and trusted tokens may call, or a token whose role lacks the permission.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "forbidden",
    "code": "insufficient_permissions",
    "message": "The supplied bearer token does not have permission to execute the provided HTTP method on the given resource.",
    "reference": "AxkklBY",
    "status": 403,
    "meta": null
  }
}
```

## Response 404

No such object (type `not_found`, code `resource_not_found`). It may belong to another account, or to the other mode: a test token cannot see live objects and a live token cannot see test ones. The message says so when the object exists in the other mode.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "not_found",
    "code": "resource_not_found",
    "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
    "reference": "qh81SPw",
    "status": 404,
    "meta": null
  }
}
```

## Response 409

Service, request identity or version conflict.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "not_found",
    "code": "resource_not_found",
    "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
    "reference": "qh81SPw",
    "status": 404,
    "meta": null
  }
}
```

## Response 413

The decoded body exceeds 1 MiB.

## Response 429

Five submissions per minute per account, shared across modes.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "not_found",
    "code": "resource_not_found",
    "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
    "reference": "qh81SPw",
    "status": 404,
    "meta": null
  }
}
```

## Response 503

Temporary failure. Preserve the body and key. Read error.meta.import_id when supplied. If no receipt ID was received, deliberately resend the same body and Idempotency-Key. Follow Retry-After.

### application/json

Fields and constraints (JSON Schema):

```json
{
  "type": "object",
  "title": "error",
  "description": "Every error response has this body, whatever the status code. Use `status` and `type` for the broad case, `code` for the exact one, and show `message` to a person.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "title": "error_details",
      "description": "The details of an error: `error` in every error response, and a failed row in a license import receipt.",
      "required": [
        "type",
        "code",
        "message",
        "reference",
        "status",
        "meta"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "The broad category. It matches `status`.",
          "enum": [
            "bad_request",
            "invalid_request",
            "unauthorized",
            "transaction_error",
            "forbidden",
            "not_found",
            "conflict",
            "unprocessable",
            "too_many_requests",
            "internal_server_error",
            "external_server_error",
            "service_unavailable",
            "external_server_timeout"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The exact error within its type, for example `invalid_input`, `invalid_token`, `payment_declined`, `insufficient_permissions`, `resource_not_found`, `in_use` or `invalid_state`. New codes may be added, so keep a fallback for each status.",
          "examples": [
            "invalid_input"
          ]
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "What went wrong and, often, how to fix it. Written for people, in the shopper's language where a translation exists. Do not parse it."
        },
        "reference": {
          "type": [
            "string",
            "null"
          ],
          "description": "A 7-character code (some newer ones are longer) that names the exact check in Comecero that refused the request. The same check always gives the same reference, so it is not unique to your request. Quote it when you contact support.",
          "examples": [
            "qh81SPw"
          ]
        },
        "status": {
          "type": "integer",
          "description": "The HTTP status code of the response.",
          "enum": [
            400,
            401,
            402,
            403,
            404,
            409,
            413,
            422,
            429,
            500,
            502,
            503,
            504
          ]
        },
        "meta": {
          "description": "More detail about the error when there is any, such as the payment that was declined. Usually `null`.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      }
    }
  },
  "example": {
    "error": {
      "type": "not_found",
      "code": "resource_not_found",
      "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
      "reference": "qh81SPw",
      "status": 404,
      "meta": null
    }
  }
}
```

Example:

```json
{
  "error": {
    "type": "not_found",
    "code": "resource_not_found",
    "message": "Event not found: 0059847953278fQmIZHpIYdE does not exist.",
    "reference": "qh81SPw",
    "status": 404,
    "meta": null
  }
}
```

Resolve remaining `$ref` pointers in /openapi.json.