# Contacts

> Solarium docs. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

## List Contacts

Returns a paginated list of vendors and customers.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `limit` | `Int` | No | Page size (default 25, max 200) |
| `offset` | `Int` | No | Number of records to skip |
| `search` | `String` | No | Filter by name |

### Request

```graphql
query {
  listContacts(
    organizationId: "a1b2c3d4-..."
    limit: 10
    search: "uber"
  ) {
    items {
      id
      contactType
      displayName
      email
      phone
      balance
      active
    }
    totalCount
  }
}
```

### Response

```json
{
  "data": {
    "listContacts": {
      "items": [
        {
          "id": "b2c3d4e5-...",
          "contactType": "vendor",
          "displayName": "Uber",
          "email": "",
          "phone": "",
          "balance": 0,
          "active": true
        }
      ],
      "totalCount": 1
    }
  }
}
```

## Create a Contact

Creates a new vendor or customer.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `contactType` | `String!` | Yes | vendor or customer |
| `displayName` | `String!` | Yes | Contact name |
| `email` | `String` | No | Email address |
| `phone` | `String` | No | Phone number |

### Request

```graphql
mutation {
  createContact(
    organizationId: "a1b2c3d4-..."
    contactType: "vendor"
    displayName: "Staples"
    email: "billing@staples.com"
  ) {
    contact { id displayName contactType }
    success
    error
  }
}
```

### Response

```json
{
  "data": {
    "createContact": {
      "contact": {
        "id": "c3d4e5f6-...",
        "displayName": "Staples",
        "contactType": "vendor"
      },
      "success": true,
      "error": null
    }
  }
}
```
