# Credentials

`FinixConfig` holds the credentials and device configuration used to initialize the SDK. Pass it to the `FinixClient` constructor.


```swift
FinixConfig(
    environment: Finix.Environment,
    credentials: Finix.APICredentials,
    merchantId: String,
    mid: String,
    deviceType: DeviceType,
    deviceId: String,
    serialNumber: String? = nil
)
```

| Field | Type | Description |
|  --- | --- | --- |
| `environment` | `Finix.Environment` | `.Sandbox` for testing, `.Production` for live payments. |
| `credentials` | `Finix.APICredentials` | Your Finix API username and password. See [APICredentials](#api-credentials). |
| `merchantId` | `String` | Your Finix Merchant ID (`MU...`). |
| `mid` | `String` | Merchant identifier number. Pass an empty string if not required. |
| `deviceType` | `DeviceType` | Set to `.Pax` for the PAX D135. |
| `deviceId` | `String` | The Finix Device ID (`DV...`) created during [device setup](/ios/card-present/device-setup). Pass an empty string on first initialization; update via `finixClient.update(deviceId:)` after device discovery. |
| `serialNumber` | `String?` | Optional. The physical serial number printed on the PAX D135 device. |


## APICredentials


```swift
Finix.APICredentials(
    username: String,
    password: String
)
```

| Field | Type | Description |
|  --- | --- | --- |
| `username` | `String` | Your Finix API key. |
| `password` | `String` | Your Finix API secret. |


The API credentials you use must have the appropriate role:

- `ROLE_MERCHANT` — for single-merchant devices. Recommended for dedicated point-of-sale hardware.
- `ROLE_PARTNER` — required for multi-merchant devices and split transactions.


## Sandbox and Production

Set `environment` to match the environment your device is designated for. Devices cannot switch environments after designation.

| Value | Environment |
|  --- | --- |
| `.Sandbox` | Sandbox |
| `.Production` | Production |