# Authenticate New Device

- Sandbox: `POST https://sandbox.payme.io/api/vas/pos/authenticate`
- Production: `POST https://live.payme.io/api/vas/pos/authenticate`

## Credentials

- Request body field `payme_client_key` (required): Your private API Key
- Request body field `seller_payme_id` (required): Your Merchant's unique ID in our system

## Overview

This method completes the pairing process started with the pair method.

## Parameters

This endpoint takes no path, query or header parameters.

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payme_client_key` | string | yes | Your private API Key |
| `seller_payme_id` | string | yes | Your Merchant's unique ID in our system |
| `pos_id` | string | yes | The ID you must choose for your POS. Must be a string of digits, between "001" and "999" |
| `terminal_id` | string | yes | A unique payment terminal identifier, this ID is displayed on the POS in the pairing process |
| `verification_code` | string | no | OTP as displayed on the POS device |

### Request example

```json
{
  "payme_client_key": "partner_key",
  "seller_payme_id": "MPLXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "pos_id": "001",
  "terminal_id": "9000015000",
  "verification_code": "123987"
}
```

## Code samples

### curl

```bash
curl -X POST 'https://sandbox.payme.io/api/vas/pos/authenticate' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "payme_client_key": "partner_key",
  "seller_payme_id": "MPLXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "pos_id": "001",
  "terminal_id": "9000015000",
  "verification_code": "123987"
}'
```

### Node.js

```javascript
const response = await fetch("https://sandbox.payme.io/api/vas/pos/authenticate", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "payme_client_key": "partner_key",
    "seller_payme_id": "MPLXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
    "pos_id": "001",
    "terminal_id": "9000015000",
    "verification_code": "123987"
  }),
});

console.log(await response.text());
```

### Python

```python
import requests

response = requests.post(
    "https://sandbox.payme.io/api/vas/pos/authenticate",
    json={
        "payme_client_key": "partner_key",
        "seller_payme_id": "MPLXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
        "pos_id": "001",
        "terminal_id": "9000015000",
        "verification_code": "123987",
    },
)

print(response.text)
```

### PHP

```php
<?php

$body = <<<'BODY'
{
  "payme_client_key": "partner_key",
  "seller_payme_id": "MPLXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "pos_id": "001",
  "terminal_id": "9000015000",
  "verification_code": "123987"
}
BODY;

$ch = curl_init('https://sandbox.payme.io/api/vas/pos/authenticate');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

## Responses

### 200 — OK (success)
