# Authentication

## Agregar merchants

<mark style="color:green;">`POST`</mark> `auth/v1/merchant/register`

Este método  registrará en merchant en la base de datos y debe devolver credenciales que podrá utilizar el merchant para administrar (Proyectos y/o Usuarios)

#### Headers

| Name     | Type   | Description                                    |
| -------- | ------ | ---------------------------------------------- |
| x-secret | String | Valor privado para poder habilitar este método |

#### Request Body

| Name                                               | Type      | Description |
| -------------------------------------------------- | --------- | ----------- |
| code\_client<mark style="color:red;">\*</mark>     | String    |             |
| document\_type<mark style="color:red;">\*</mark>   | String    |             |
| document\_number<mark style="color:red;">\*</mark> | String    |             |
| company\_name<mark style="color:red;">\*</mark>    | String    |             |
| company\_country<mark style="color:red;">\*</mark> | String    |             |
| white\_list\_ips                                   | String\[] |             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
"merchant": {
    id: string,
    status: string,
    code_client: string,
    document_type: string,
    document_number: string,
    company_name: string,
    company_country: string
},
"merchant_access_tokens": [
  {
      "id": string,
      "status": string
      "public_key": string,
      "secret_key": string,
      "is_verify": boolean,
      "access_role": string
  }
]
}
```

{% endtab %}
{% endtabs %}

## Inicio de sesión de un merchant

<mark style="color:green;">`POST`</mark> `/auth/v1/merchant/login`

#### Request Body

| Name        | Type   | Description |
| ----------- | ------ | ----------- |
| public\_key | String |             |
| secret\_key | String |             |
