# 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 |             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.globalbridgeconnections.com/core-api/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
