# Merchants

## Información del Merchant

<mark style="color:blue;">`GET`</mark> `/api-hub/v1/merchants/me`

Datos de un merchant que consulta el endpoint con su llave pública

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                    |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| 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> |        | <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.                                                                               |

{% tabs %}
{% tab title="200 Solicitud realizada con éxito" %}

```javascript
{
	"code": "00000",
	"message": "Successful",
	"data": {
		"id": "ea6b7751-babb-b35c-f1b1-c4936bdd16ce",
		"status": "ACTIVE",
		"created_at": "2022-09-15T16:50:33.995476+00:00",
		"updated_at": "2022-09-15T16:50:33.995476+00:00",
		"deleted_at": null,
		"is_deleted": false,
		"is_deleted_by": null,
		"code_client": "2121",
		"document_type": "RUC",
		"document_number": "20551990860",
		"company_name": "GLOBAL BRIDGE CONNECTIONS S.A.C.",
		"company_country": "PER",
		"white_list_ips": [
			""
		],
		"merchant_access_token": {
			"id": "e1cac68b-d4ca-b516-fd89-ad21cc14e731",
			"status": "ACTIVE",
			"created_at": "2022-09-15T16:50:33.995476+00:00",
			"updated_at": "2022-09-15T16:50:33.995476+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"merchant_id": "ea6b7751-babb-b35c-f1b1-c4936bdd16ce",
			"public_key": "c1e146fe-2baf-aeb8-4648-07d7d45f5f92",
			"secret_key": "995cd4b2-xxx3-5b90-a120-a4a8004c3fd8"
		}
	}
}
```

{% endtab %}

{% tab title="401: Unauthorized Cuando el authorization-token no es enviado" %}

```javascript
{
    "message": "Authorization is missing",
    "data": []
}
```

{% endtab %}
{% endtabs %}

## Lista de clientes del Merchant

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

#### Query Parameters

| Name                                        | Type   | Description                                                                                                                    |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| 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 |
| page                                        | Number | El valor indica la página que se desea visualizar, el valor por defecto en caso no se mande es 1.                              |
| per\_page                                   | Number | El valor indica la cantidad de registros que se desea visualizar por página, el valor por defecto en caso no se mande es 15.   |

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

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

```javascript
{
    "code": "00000",
    "message": "Successful",
    "data": [
        {
            "id": "4302a1f9-aa3f-6e81-b006-f53c2b4ec056",
            "status": "ACTIVE",
            "created_at": "2022-09-21T15:03:26.797578+00:00",
            "updated_at": "2022-09-21T15:03:29.344627+00:00",
            "deleted_at": null,
            "is_deleted": false,
            "is_deleted_by": null,
            "document_type": "DNI",
            "document_number": "12345678",
            "first_name": "MARCOS",
            "first_last_name": "RAMOS",
            "status_kyc": null,
            "birth_country": "PER",
            "birth_date": "1995-10-17",
            "residence_address": "JR LOS RIOS",
            "residence_country": "PER",
            "residence_city": "AYACUCHO",
            "residence_zip_code": "50002",
            "phone_country_code": "+51",
            "phone_number": "902000000",
            "email": "TEST@GMAIL.COM",
            "landline_country_code": null,
            "landline_number": null,
            "occupation": "ING. SISTEMAS",
            "merchant_id": "cc989743-6db7-e2d5-00d0-8477ddfcf98c",
            "provider_name": "ODYBANK",
            "provider_reference": "298731",
            "internal_reference": "223300000001",
            "second_name": "PEDRI",
            "second_last_name": "LICAS",
            "gender": "M"
        }
    ],
    "metadata": {
        "pagination": {
            "total": 5,
            "page": 1,
            "per_page": 1,
            "previous_page": null,
            "next_page": 2,
            "first_page": 1,
            "last_page": 5
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Lista de lotes de productos del Merchant

<mark style="color:blue;">`GET`</mark> `/api-hub/v1/merchants/lots`

#### Query Parameters

| Name                                        | Type             | Description                                                                                                                    |
| ------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| page<mark style="color:red;">\*</mark>      | Number           | El número de página del listado de lotes.                                                                                      |
| per\_page<mark style="color:red;">\*</mark> | Number           | El cantidad de lotes vistos en el listado de lotes.                                                                            |
| timestamp<mark style="color:red;">\*</mark> | Number \| 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 del timestamp y el secret-key.                                                                               |

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

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>	"code": "00000",
	"message": "Successful",
	"data": [
		{
			"id": "bb0a5f45-6f67-6d59-7c65-301ec309b130",
			"status": "SENT",
			"created_at": "2022-10-10T21:31:29.194111+00:00",
			"updated_at": "2022-10-10T21:31:29.194111+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"number_lot": 23,
			"quantity_card": 10,
			"type_affiliation": "NOMINATED",
			"type_card": "VIRTUAL",
			"merchant_product_id": "5d71b4b0-991f-90ad-c50f-178530f54824",
			"merchant_id": "ea6b7751-babb-b35c-f1b1-c4936bdd16ce"
		},
		{
			"id": "49446dd7-9a25-f6a5-0284-79cee0a338c2",
			"status": "SENT",
			"created_at": "2022-10-10T21:32:22.114394+00:00",
			"updated_at": "2022-10-10T21:32:22.114394+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"number_lot": 24,
			"quantity_card": 10,
			"type_affiliation": "NOMINATED",
			"type_card": "VIRTUAL",
			"merchant_product_id": "5d71b4b0-991f-90ad-c50f-178530f54824",
			"merchant_id": "ea6b7751-babb-b35c-f1b1-c4936bdd16ce"
		},
		{
			"id": "fc3c5ac9-2a1e-dd23-03c6-6ddcf0f465b5",
			"status": "SENT",
			"created_at": "2022-10-10T21:32:31.555597+00:00",
			"updated_at": "2022-10-10T21:32:31.555597+00:00",
			"deleted_at": null,
			"is_deleted": false,
			"is_deleted_by": null,
			"number_lot": 25,
			"quantity_card": 10,
			"type_affiliation": "NOMINATED",
			"type_card": "VIRTUAL",
			"merchant_product_id": "5d71b4b0-991f-90ad-c50f-178530f54824",
			"merchant_id": "ea6b7751-babb-b35c-f1b1-c4936bdd16ce"
		}
	],
	"metadata": {
		"pagination": {
			"total": 4,
			"page": 1,
			"per_page": 3,
			"previous_page": null,
			"next_page": 2,
			"first_page": 1,
			"last_page": 2
		}
	}
}
</code></pre>

{% endtab %}
{% endtabs %}


---

# 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/merchants.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.
