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

# Accounts

> Create and retrieve account records via the FieldIU API

Accounts represent your clients or organizations in FieldIU. Use these endpoints to create new accounts or retrieve existing ones.

***

## Create Account

<api-reference>POST /api/v1/accounts</api-reference>

Creates a new account record in FieldIU.

### Request Body

<ParamField body="name" type="string">
  Account display name
</ParamField>

<ParamField body="email" type="string">
  Account email address
</ParamField>

<ParamField body="accountType" type="integer">
  Account type identifier. See [NullableOfaccount\_ha\_accounttype](/developer-guide/models#accountrequest) for valid values
</ParamField>

<ParamField body="legalName" type="string">
  Legal registered name of the organization
</ParamField>

<ParamField body="defaultPaymentTerms" type="integer">
  Default payment terms. See [NullableOfaccount\_ha\_defaultpaymentterms](/developer-guide/models#accountrequest) for valid values
</ParamField>

<ParamField body="trnNumber" type="string">
  Tax registration number
</ParamField>

<ParamField body="licenseNumber" type="string">
  Business license number
</ParamField>

<ParamField body="businessPhone" type="string">
  Primary business phone number
</ParamField>

<ParamField body="buildingLocation" type="string">
  Building or location name
</ParamField>

<ParamField body="street1" type="string">
  Street address line 1
</ParamField>

<ParamField body="street2" type="string">
  Street address line 2
</ParamField>

<ParamField body="city" type="string">
  City
</ParamField>

<ParamField body="postalCode" type="string">
  Postal / ZIP code
</ParamField>

<ParamField body="state" type="string">
  State or province
</ParamField>

<ParamField body="country" type="string">
  Country
</ParamField>

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://integration.fieldiu.online/api/v1/accounts \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: your_api_key" \
    -H "X-ORG-ID: your_org_id" \
    -d '{
      "name": "Acme Corporation",
      "email": "billing@acme.com",
      "accountType": 1,
      "legalName": "Acme Corporation LLC",
      "businessPhone": "+1-555-000-1234",
      "street1": "123 Main Street",
      "city": "Dubai",
      "country": "UAE"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://integration.fieldiu.online/api/v1/accounts', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-KEY': 'your_api_key',
      'X-ORG-ID': 'your_org_id'
    },
    body: JSON.stringify({
      name: 'Acme Corporation',
      email: 'billing@acme.com',
      accountType: 1,
      legalName: 'Acme Corporation LLC',
      businessPhone: '+1-555-000-1234',
      street1: '123 Main Street',
      city: 'Dubai',
      country: 'UAE'
    })
  });
  ```
</CodeGroup>

### Response

`200 OK` — Account created successfully.

***

## List Accounts

<api-reference>GET /api/v1/accounts</api-reference>

Returns a paginated list of all accounts in your organization.

### Query Parameters

<ParamField query="page" type="integer">
  Page number for pagination (1-based)
</ParamField>

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://integration.fieldiu.online/api/v1/accounts?page=1" \
    -H "X-API-KEY: your_api_key" \
    -H "X-ORG-ID: your_org_id"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://integration.fieldiu.online/api/v1/accounts?page=1', {
    headers: {
      'X-API-KEY': 'your_api_key',
      'X-ORG-ID': 'your_org_id'
    }
  });
  ```
</CodeGroup>

### Response

`200 OK` — Returns a list of account objects.

***

## Get Account by ID

<api-reference>GET /api/v1/accounts/\{id}</api-reference>

Returns a single account record by its unique identifier.

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the account
</ParamField>

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET https://integration.fieldiu.online/api/v1/accounts/abc-123 \
    -H "X-API-KEY: your_api_key" \
    -H "X-ORG-ID: your_org_id"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://integration.fieldiu.online/api/v1/accounts/abc-123', {
    headers: {
      'X-API-KEY': 'your_api_key',
      'X-ORG-ID': 'your_org_id'
    }
  });
  ```
</CodeGroup>

### Response

`200 OK` — Returns the account object for the given ID.
