> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcurrent.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# Pre-fill Business

> Fast typeahead lookup that returns ranked, already-canonical candidate
business profiles for a name, business number (BN), or registration
number. Designed to power an as-you-type autocomplete that auto-populates
a business record — it is intentionally lightweight and does **not** run
the full `/search` orchestration (no website analysis, sanctions, or
report fetch).

Sources are queried in parallel and merged, then deduplicated and ranked.
A slow or unavailable source is skipped without blocking the response —
inspect `sourcesSucceeded` / `sourcesFailed` to see which contributed.

Identifier-shaped queries (BN, registration number) are auto-detected and
exact matches are pinned to the top.

**Typical response time:** under 1 second.




## OpenAPI

````yaml /openapi.yaml post /prefill
openapi: 3.1.0
info:
  title: Current Business Verification API
  version: 1.0.0
  description: >
    The Current API provides programmatic access to Canadian business
    verification services.


    ## Authentication

    All API requests require authentication via API key. Include your key using
    one of these methods:

    - `Authorization: Bearer cur_live_xxxxx` (recommended)

    - `X-API-Key: cur_live_xxxxx`


    ## Rate Limits

    All endpoints are rate limited to **60 requests per minute** per API key.


    Rate limit headers are included in all responses:

    - `X-RateLimit-Limit`: Maximum requests allowed in current window

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - `X-RateLimit-Reset`: Unix timestamp when the rate limit resets


    ## Request IDs

    All responses include an `X-Request-Id` header for traceability.

    You can provide your own via the `X-Request-Id` request header; otherwise
    one is generated automatically.

    Include this ID when contacting support about a specific request.
  contact:
    name: Current Support
    url: https://getcurrent.ca
  license:
    name: Proprietary
servers:
  - url: https://api.getcurrent.ca/v1
    description: Production
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Search
    description: Business verification search operations
  - name: Pre-fill
    description: Fast typeahead lookup of canonical business candidates
  - name: Generate PDF
    description: PDF report generation
  - name: Business Reports
    description: Business report operations
  - name: Sanctions
    description: Standalone sanctions screening operations
  - name: Verification
    description: Business verification operations
  - name: Businesses
    description: >-
      Business record sync (list/read as a change feed, upsert to keep records
      current)
paths:
  /prefill:
    post:
      tags:
        - Pre-fill
      summary: Pre-fill Business
      description: >
        Fast typeahead lookup that returns ranked, already-canonical candidate

        business profiles for a name, business number (BN), or registration

        number. Designed to power an as-you-type autocomplete that
        auto-populates

        a business record — it is intentionally lightweight and does **not** run

        the full `/search` orchestration (no website analysis, sanctions, or

        report fetch).


        Sources are queried in parallel and merged, then deduplicated and
        ranked.

        A slow or unavailable source is skipped without blocking the response —

        inspect `sourcesSucceeded` / `sourcesFailed` to see which contributed.


        Identifier-shaped queries (BN, registration number) are auto-detected
        and

        exact matches are pinned to the top.


        **Typical response time:** under 1 second.
      operationId: prefillBusiness
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrefillRequest'
            examples:
              byName:
                summary: By business name
                value:
                  query: Shopify
              byBusinessNumber:
                summary: By CRA Business Number
                value:
                  query: '123456789'
              byRegistrationNumber:
                summary: By registration number (limited results)
                value:
                  query: BC0871095
                  limit: 5
      responses:
        '200':
          description: Ranked candidate businesses
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrefillResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
        - apiKeyHeader: []
components:
  schemas:
    PrefillRequest:
      type: object
      required:
        - query
      properties:
        query:
          type: string
          minLength: 2
          description: >
            Business name, business number (BN), or registration number.
            Identifier-shaped queries are auto-detected and exact matches are
            ranked first.
          example: Shopify
        limit:
          type: integer
          minimum: 1
          maximum: 25
          default: 10
          description: Maximum number of candidates to return.
    PrefillResponse:
      type: object
      required:
        - query
        - mode
        - candidates
        - sourcesSucceeded
        - sourcesFailed
        - searchedAt
      properties:
        query:
          type: string
          description: The query that was processed (trimmed).
        mode:
          type: string
          enum:
            - name
            - bn
            - registration_number
            - federal_corp_number
          description: >-
            How the query was interpreted. A ranking hint — all sources still
            run.
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/PrefillCandidate'
          description: Ranked candidates (highest match first), capped at `limit`.
        sourcesSucceeded:
          type: array
          items:
            $ref: '#/components/schemas/PrefillSource'
          description: >-
            Sources that responded successfully (a source can succeed with zero
            matches).
        sourcesFailed:
          type: array
          items:
            $ref: '#/components/schemas/PrefillSource'
          description: >-
            Sources that timed out or errored. Their absence never blocks the
            response.
        searchedAt:
          type: string
          format: date-time
    PrefillCandidate:
      type: object
      description: A canonical candidate business profile, ready to populate a record.
      required:
        - legalName
        - matchScore
        - sources
      properties:
        legalName:
          type: string
        operatingNames:
          type: array
          items:
            type: string
          description: Trade / operating names.
        registrationNumbers:
          type: array
          items:
            $ref: '#/components/schemas/PrefillRegistrationNumber'
        entityType:
          type:
            - string
            - 'null'
          description: >
            Entity type normalized to a canonical set (e.g. "Corporation",
            "General Partnership", "Not-For-Profit").
        sourceEntityType:
          type:
            - string
            - 'null'
          description: >
            The registry's original entity-type wording before normalization
            (e.g. "Business corporation", "BC Company"), when it differs from
            `entityType`.
        status:
          type:
            - object
            - 'null'
          description: >
            Current registration state only. Pre-fill is a fast identity lookup,
            not a point-in-time verification, so `status` carries no per-field
            timestamp — use the response-level `searchedAt` for freshness.
          properties:
            state:
              type: string
              description: e.g. "Active", "Inactive", "Dissolved".
        incorporationDate:
          type:
            - string
            - 'null'
          description: ISO date (YYYY-MM-DD) when available.
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        matchScore:
          type: number
          minimum: 0
          maximum: 1
          description: Relevance score; exact identifier matches are pinned to 1.
        sources:
          type: array
          items:
            $ref: '#/components/schemas/PrefillSource'
          description: Which sources contributed to this candidate (deduped union).
    PrefillSource:
      type: string
      enum:
        - business_registries
        - federal_corporations
        - orgbook_bc
        - regulatory
      description: >
        A data source contributing candidates: `business_registries` Canadian
        Business Registries · `federal_corporations` Corporations Canada ·
        `orgbook_bc` BC registry (OrgBook) · `regulatory` regulatory registries
        (charities, MSB, cannabis, etc.).
    ErrorResponse:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: >
            Machine-readable error code. Present on every error response.
            Distinct from the per-source `APIError.code` values that appear
            inside a successful response's `meta.errors` object.
          enum:
            - MISSING_API_KEY
            - INVALID_API_KEY
            - REVOKED_API_KEY
            - EXPIRED_API_KEY
            - RATE_LIMITED
            - VALIDATION_ERROR
            - INVALID_JSON
            - NOT_FOUND
            - STALE_WRITE
            - CONFLICT
            - METHOD_NOT_ALLOWED
            - UNAUTHORIZED
            - SERVER_ERROR
            - INTERNAL_ERROR
          example: VALIDATION_ERROR
    PrefillRegistrationNumber:
      type: object
      required:
        - type
        - value
      properties:
        type:
          type: string
          enum:
            - federal
            - provincial
            - business_number
            - charity
            - msb
            - other
        value:
          type: string
        jurisdiction:
          type: string
          description: e.g. "FED" (federal), "BC", "ON".
        label:
          type: string
          description: >-
            Human-readable label (e.g. "Federal Corporation Number", "Business
            Number (CRA)").
    Address:
      type: object
      description: Business address with structured nullable fields
      properties:
        street:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        province:
          type:
            - string
            - 'null'
          description: Full province name (e.g., "Ontario", "British Columbia")
        postalCode:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
          description: Full country name (e.g., "Canada")
        raw:
          type:
            - string
            - 'null'
          description: Original unstructured address string from the source
  headers:
    X-Request-Id:
      description: >-
        Unique request identifier for traceability. Echoes client-provided value
        or auto-generated UUID.
      schema:
        type: string
        format: uuid
        example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
    X-RateLimit-Limit:
      description: Maximum requests per minute
      schema:
        type: integer
        example: 60
    X-RateLimit-Remaining:
      description: Remaining requests in current window
      schema:
        type: integer
        example: 58
    X-RateLimit-Reset:
      description: Unix timestamp when rate limit resets
      schema:
        type: integer
        example: 1702915200
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: name is required and must be a non-empty string
            code: VALIDATION_ERROR
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              value:
                error: >-
                  Missing API key. Provide via Authorization: Bearer <key> or
                  X-API-Key header.
                code: MISSING_API_KEY
            invalid:
              value:
                error: Invalid API key
                code: INVALID_API_KEY
            revoked:
              value:
                error: API key has been revoked
                code: REVOKED_API_KEY
            expired:
              value:
                error: API key has expired
                code: EXPIRED_API_KEY
    RateLimited:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          description: Seconds until rate limit resets
          schema:
            type: integer
            example: 60
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Rate limit exceeded. Try again in 60 seconds.
            code: RATE_LIMITED
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Internal server error
            code: SERVER_ERROR
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key as Bearer token: `Authorization: Bearer cur_live_xxxxx`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key in header: `X-API-Key: cur_live_xxxxx`'

````