# Clients

## Consulta de un cliente final por ID o Internal reference.

<mark style="color:blue;">`GET`</mark> `/api-hub/v1/clients/{term}`

#### Path Parameters

| Name                                   | Type   | Description                                                                                |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------ |
| term<mark style="color:red;">\*</mark> | String | El valor puede ser el CLIENT\_ID, el INTERNAL\_REFERENCE del cliente o el DOCUMENT\_NUMBER |

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                      |
| ------------------------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| timestamp<mark style="color:red;">\*</mark> | String | El valor debe ser en formato UNIX, comprendido por 13 dígitos. En javascript se puede usar la función Date.now() = 1664568045547 |

#### Headers

| Name                                                  | Type   | Description                                                                                                                  |
| ----------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| authorization-token<mark style="color:red;">\*</mark> | String | <p>Se envía el token generado luego del Login, y debe contar con el siguiente formato:</p><p>"Bearer JHgytHG67687JHG..."</p> |
| signature<mark style="color:red;">\*</mark>           | String | La firma depende del timestamp y el secret-key.                                                                              |

{% tabs %}
{% tab title="200: OK Datos del cliente" %}

**status** : El estado tiene que estar activo, si no es el caso hay un endpoint para reactivar al usuario

**provider\_reference** : Es el código de Unibanca

**internal\_reference** : Rastreo interno del cliente del negocio

```javascript
{
	"code": "00000",
	"message": "Successful",
	"data": {
		"id": "f6d61675-fc97-341a-fe59-52fa38a508f2",
		"status": "ACTIVE",
		"created_at": "2022-09-22T18:34:24.561033+00:00",
		"updated_at": "2022-09-22T18:34:25.854273+00:00",
		"deleted_at": null,
		"is_deleted": false,
		"is_deleted_by": null,
		"document_type": "DNI",
		"document_number": "47461000",
		"first_name": "MARIA",
		"first_last_name": "PEREZ",
		"status_kyc": null,
		"birth_country": "PER",
		"birth_date": "1993-09-26",
		"residence_address": "CAL.CORONEL INCLÁN NRO",
		"residence_country": "PER",
		"residence_city": "LIMA",
		"residence_zip_code": "15074",
		"phone_country_code": "+51",
		"phone_number": "924027000",
		"email": "CLIENTE@GLOBALBRIDGECONNECTIONS.COM",
		"landline_country_code": null,
		"landline_number": null,
		"occupation": "ADMINISTRADOR DE EMPRESAS",
		"merchant_id": "a6764840-1626-b4c1-eb52-bedef14e6596",
		"provider_name": "ODYBANK",
		"provider_reference": "80",
		"internal_reference": "100200000001",
		"second_name": "ROSA",
		"second_last_name": "GONZALEZ",
		"gender": "F"
	},
	"metadata": {
		"term": "100200000001"
	}
}
```

{% endtab %}
{% endtabs %}

## En este endpoint detallamos cómo es la creación de un cliente final para un negocio

<mark style="color:green;">`POST`</mark> `/api-hub/v1/clients`

#### Headers

| Name                                                  | Type   | Description                                                                                                                   |
| ----------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| authorization-token<mark style="color:red;">\*</mark> | String | <p>Se envía el token generado luego del Login, se debe enviar con el siguiente formato:</p><p>"Bearer JHgytHG67687JHG..."</p> |
| signature<mark style="color:red;">\*</mark>           | String | La firma depende del timestamp y el secret-key.                                                                               |

#### Request Body

| Name                                                   | Type   | Description                                                                                                                    |
| ------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| document\_type<mark style="color:red;">\*</mark>       | String | El tipo de documento debe de ser DNI, CE, PAS, RUC o PTP.                                                                      |
| document\_number<mark style="color:red;">\*</mark>     | String | Para el valor del número de documento está relacionado con el document\_type, en la cantidad de dígitos.                       |
| first\_name<mark style="color:red;">\*</mark>          | String | El primer nombre del cliente.                                                                                                  |
| second\_name                                           | String | El segundo nombre del cliente.                                                                                                 |
| first\_last\_name<mark style="color:red;">\*</mark>    | String | El apellido paterno o primer apellido del cliente.                                                                             |
| second\_last\_name                                     | String | El apellido materno o segundo apellido del cliente.                                                                            |
| gender<mark style="color:red;">\*</mark>               | String | El género del cliente debe de ser F (Femenino) o M (Masculino).                                                                |
| birth\_country<mark style="color:red;">\*</mark>       | Date   | El país de nacimiento debe de ser en formato ISO 3.                                                                            |
| birth\_date<mark style="color:red;">\*</mark>          | String | La fecha de nacimiento debe de ser en formato (YYY-MM-DD).                                                                     |
| residence\_address<mark style="color:red;">\*</mark>   | String | La dirección de residencia del cliente.                                                                                        |
| residence\_country<mark style="color:red;">\*</mark>   | String | El país de residencia debe de ser en formato ISO 3.                                                                            |
| residence\_city<mark style="color:red;">\*</mark>      | String | La ciudad de residencia del cliente.                                                                                           |
| residence\_zip\_code<mark style="color:red;">\*</mark> | String | El código postal de residencia del cliente.                                                                                    |
| phone\_country\_code<mark style="color:red;">\*</mark> | String | El código de país del teléfono del cliente.                                                                                    |
| phone\_number<mark style="color:red;">\*</mark>        | String | El número de teléfono o celular del cliente.                                                                                   |
| email<mark style="color:red;">\*</mark>                | String | La dirección de correo electrónico del cliente.                                                                                |
| occupation<mark style="color:red;">\*</mark>           | String | La ocupación o carrera profesional del cliente.                                                                                |
| timestamp<mark style="color:red;">\*</mark>            | String | El valor debe ser en formato NOW comprendido por 13 dígitos, en javascript se puede usar la función Date.now() = 1664568045547 |

{% tabs %}
{% tab title="200: OK Cliente creado con exito" %}

```javascript
{
	"document_type": "DNI",
	"document_number": "400000",
	"first_name": "MARIA",
	"second_name":"JOSEFA",
	"first_last_name": "PEREZ",
	"second_last_name": "GOMEZ",
	"gender": "F",
  	"birth_country": "PER",
  	"birth_date": "1993-09-26",
	"residence_address": "CAL.CORONEL INCLÁN",
	"residence_country": "PER",
  	"residence_city": "LIMA",
	"residence_zip_code": "15074",
  	"phone_country_code": "+51",
  	"phone_number": "924020000",
  	"email": "CLIENTE@GLOBALBRIDGECONNECTIONS.COM",
	"occupation": "ADMINISTRADOR DE EMPRESAS",
	"timestamp": "1663876446257"
}
```

**internal\_reference** Rastreo interno del cliente del negocio

**provider\_reference** Es el código de Unibanca

**status** El estado tiene que estar activo, si no es el caso hay un endpoint para reactivar al usuario
{% endtab %}
{% endtabs %}

## Este endpoint detalla la reactivación de un cliente que tiene un status INACTIVE para poder sincronizar datos

<mark style="color:green;">`POST`</mark> `/api-hub/v1/clients/reactive`

#### Headers

| Name                                                  | Type   | Description                                                                                                                   |
| ----------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| authorization-token<mark style="color:red;">\*</mark> | String | <p>Se envía el token generado luego del Login, se debe enviar con el siguiente formato:</p><p>"Bearer JHgytHG67687JHG..."</p> |
| signature<mark style="color:red;">\*</mark>           | String | La firma depende del timestamp y el secret-key.                                                                               |

#### Request Body

| Name                                        | Type   | Description                                                                                                                    |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| id<mark style="color:red;">\*</mark>        | UUID   | El identificador de cliente, en formato UUID.                                                                                  |
| timestamp<mark style="color:red;">\*</mark> | String | El valor debe ser en formato NOW comprendido por 13 dígitos, en javascript se puede usar la función Date.now() = 1664568045547 |

{% tabs %}
{% tab title="200: OK Respuesta objeto cliente" %}
**status** : El estado tiene que estar activo, si no es el caso hay un endpoint para reactivar al usuario

**provider\_reference** : Es el código de Unibanca

**internal\_reference** : Rastreo interno del cliente del negocio

```javascript
{
	"code": "00000",
	"message": "Successful",
	"data": {
		"id": "6e28b4dc-a81c-6464-8534-ec489c221a58",
		"status": "ACTIVE",
		"created_at": "2022-09-22T19:54:55.980016+00:00",
		"updated_at": "2022-09-22T19:54:58.284801+00:00",
		"deleted_at": null,
		"is_deleted": false,
		"is_deleted_by": null,
		"document_type": "DNI",
		"document_number": "4746000",
		"first_name": "MARIA",
		"first_last_name": "PEREZ",
		"status_kyc": null,
		"birth_country": "PER",
		"birth_date": "1993-09-26",
		"residence_address": "CAL.CORONEL INCLÁN",
		"residence_country": "PER",
		"residence_city": "LIMA",
		"residence_zip_code": "15074",
		"phone_country_code": "+51",
		"phone_number": "924027014",
		"email": "CLIENTE@GLOBALBRIDGECONNECTIONS.COM",
		"landline_country_code": null,
		"landline_number": null,
		"occupation": "ADMINISTRADOR DE EMPRESAS",
		"merchant_id": "a6764840-1626-b4c1-eb52-bedef14e6596",
		"provider_name": "ODYBANK",
		"provider_reference": "2432754",
		"internal_reference": "100200000001",
		"second_name": "ROSA",
		"second_last_name": "CASTRO",
		"gender": "F"
	}
}
```

{% endtab %}
{% endtabs %}

## Consultar todas las tarjetas de un cliente

<mark style="color:blue;">`GET`</mark> `/api-hub/v1/clients/{client_id}/cards`

#### Path Parameters

| Name                                         | Type | Description                   |
| -------------------------------------------- | ---- | ----------------------------- |
| client\_id<mark style="color:red;">\*</mark> | UUID | El identificador del cliente. |

#### Query Parameters

| Name                                        | Type               | Description                                                                                                                    |
| ------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| page<mark style="color:red;">\*</mark>      | Number             | El número de página del listado.                                                                                               |
| per\_page                                   | Number             | El cantidad de elementos vistos en el listado.                                                                                 |
| status                                      | ACTIVE \| INACTIVE | Filtrar por el estado de las tarjetas.                                                                                         |
| timestamp<mark style="color:red;">\*</mark> | String             | El valor debe ser en formato NOW comprendido por 13 dígitos, en javascript se puede usar la función Date.now() = 1664568045547 |

#### Headers

| Name                                                  | Type   | Description                                                                                                                   |
| ----------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| authorization-token<mark style="color:red;">\*</mark> | String | <p>Se envía el token generado luego del Login, se debe enviar con el siguiente formato:</p><p>"Bearer JHgytHG67687JHG..."</p> |
| signature<mark style="color:red;">\*</mark>           | String | La firma depende de todos los campos enviados por el query, ordenados de forma alfabética y el secret-key.                    |

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

```javascript
{
	"code": "00000",
	"message": "Successful",
	"data": [
		{
			"id": "5a54a561-b82c-c440-1ac0-d62e4d57f55g",
			"status": "INACTIVE",
			"created_at": "2022-09-22T15:14:10.194442+00:00",
			"updated_at": "2022-09-22T16:47:34.454138+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"provider_name": "ODYBANK",
			"card_tracking_code": "2333",
			"merchant_product_id": "5d71b4b0-991f-90ad-c50f-178530f54546",
			"client_id": "854c8fd2-3b39-c232-2cfe-59d1aec654a2",
			"reason": null,
			"currencies": [
				{
					"account": "2333",
					"currency": "PEN"
				}
			],
			"blocked_at": null,
			"replacement_by": null
		},
		{
			"id": "708b7d77-f229-68f7-bbbc-27dbadbedudf",
			"status": "ACTIVE",
			"created_at": "2022-09-22T17:10:02.285965+00:00",
			"updated_at": "2022-09-22T17:10:02.285965+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"provider_name": "ODYBANK",
			"card_tracking_code": "2222",
			"merchant_product_id": "3f45b4b0-78jh-76fg-c50f-178530f54765",
			"client_id": "854c8fd2-3b39-c232-2cfe-59d1aec654a2",
			"reason": null,
			"currencies": [
				{
					"account": "2222",
					"currency": "PEN"
				}
			],
			"blocked_at": null,
			"replacement_by": null
		}
	],
	"metadata": {
		"query": {},
		"params": {
			"client_id": "854c8fd2-3b39-c232-2cfe-59d1aec654a2"
		},
		"pagination": {
			"page": 1,
			"total": 2,
			"per_page": 15,
			"last_page": 1,
			"next_page": null,
			"first_page": 1,
			"previous_page": null
		}
	}
}
```

{% endtab %}
{% endtabs %}

Definiciones de campos

* **document\_type** DNI, CE, PAS, RUC, PTP
* **gender** F ⇒ FEMENINO, M ⇒ MASCULINO
* **birth\_country** ISO 3
* **birth\_date** YYYY-MM-DD
* **residence\_country** ISO 3


---

# 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/reference/api-reference/clients.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.
