# Get an import receipt (/api/licenses/get-license-import)

`GET https://api.comecero.com/api/v1/license_services/{license_service_id}/imports/{import_id}`

Read saved row results, including a request still running after a lost reply. Secret and trusted tokens need license and service read access. Limited tokens cannot read receipts. Full keys are hidden. Read this before retrying the same body and key. Wait for each license's active_in_apollo before using devices, even when the import is completed.

## Request parameters

### license_service_id (path, required)

The resource id.

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

### import_id (path, required)

The resource id.

```json
{
  "type": "string",
  "pattern": "^lim_[0-9a-f]{64}$"
}
```

## Response 200

The saved receipt.

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

## 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
  }
}
```

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