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

# Get a firm

> Fetch one client firm on your ScripX desk by IEC and read its live connection state.

One registered firm, current state. Requires the `firms` scope. Tenant-isolated: a firm on another desk is a `404`, existence is never leaked.

### Request example

```bash theme={"dark"}
curl "https://api.scripxhq.com/v1/firms/0512345678" \
  -H "X-ScripX-Key: <YOUR_API_KEY>"
```

### Response example

```json theme={"dark"}
{
  "firm": {
    "iec": "0512345678",
    "name": "Acme Exports Pvt Ltd",
    "role": "exporter",
    "state": "verification_pending",
    "created_at": "2026-07-24T13:20:11+05:30"
  }
}
```

`verification_pending` means the one-time code is outstanding; complete it via [authorize](/api-reference/firms/authorize). The full vocabulary is on [Register a firm](/api-reference/firms/create#firm-states).

### Errors

* `404 not_found`, no such firm on your desk.

**Terms used here:** [IEC](/annexure/terminology#iec), [connection state](/annexure/terminology#connection-state), [API key](/annexure/terminology#api-key), [scope](/annexure/terminology#scope). Full list in the [terminology annexure](/annexure/terminology).

### Next steps

* Once `connected`: [quote](/api-reference/trading/quote) and [place orders](/api-reference/trading/orders-create).


## OpenAPI

````yaml GET /v1/firms/{iec}
openapi: 3.1.0
info:
  title: ScripX Partner API
  version: 1.2.0
  description: >-
    Automate duty-credit-scrip trading: quote, order, positions, market,
    webhooks. Auth: `X-ScripX-Key: scripx_live_…`. Money = integer paise; price
    = bps of face.
  contact:
    name: ScripX API Support
    email: amin@eximfiles.io
    url: https://scripxhq.com
servers:
  - url: https://api.scripxhq.com
    description: >-
      Production and sandbox share one host; a scripx_test_ key selects the
      sandbox.
security:
  - ApiKeyAuth: []
tags:
  - name: Firms
    description: >-
      client-firm lifecycle: register, verify, authorize, credits, update,
      offboard
  - name: Trading
    description: quote, orders, positions, market
  - name: Group
    description: intra-group netting + positions (enterprise/broker)
  - name: Cross
    description: 'broker cross-desk: block deals + intra-group transfers'
  - name: Webhooks
    description: event subscriptions + delivery
  - name: Account
    description: usage + metering
  - name: Keys
    description: self-serve scoped child keys (sub-accounts)
paths:
  /v1/firms/{iec}:
    get:
      tags:
        - Firms
      summary: Get one client firm + connection state
      parameters:
        - name: iec
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FirmRecord'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FirmRecord:
      type: object
      properties:
        firm:
          $ref: '#/components/schemas/Firm'
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: stable machine code
          enum:
            - bad_request
            - unauthorized
            - forbidden
            - not_found
            - conflict
            - unprocessable
            - rate_limited
            - internal
        message:
          type: string
        detail:
          type: object
    Firm:
      type: object
      properties:
        iec:
          type: string
        name:
          type: string
        email:
          type: string
        role:
          type: string
          enum:
            - exporter
            - importer
        state:
          type: string
          enum:
            - registered
            - connecting
            - verification_pending
            - connected
            - attention_needed
            - reconnect_needed
        created_at:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-ScripX-Key
      description: >-
        Your API key, e.g. `scripx_live_…`. Bound to one firm; tenant isolation
        is enforced.

````