# Billpay Quickstart Guide

Greetings, welcome to Monato-API, in this quickstart you will find all the requirements to consume our API v1.

## Environments

The Monato Team manages Sandbox and Production environments:

**Sandbox:** In this enviroment developers can make API calls and receive mocked responses so they can get to know how the API behaves in each scenario.

> The Sandbox Enviroment is were the client will certified the integration.


You can make requests to sandbox environment in the following URL: https://dev-api.finco.lat

**Production:** When the integration is certified the finch team will provide the production ApiKey.

You can make requests to production environment in the following URL: https://api.finco.lat

> The Timeout for requests is 60 seconds.


> All Requests must use the HTTPS protocol.


### 1. Authentication

To Authenticate the Finch-API you must have the Authentication header with your Bearer token (ApiKey) in all your requests.

Example:


```
$ curl https://dev-api.finco.lat/api/v1/client/account \
-H 'Authorization: Bearer your_api_key'
```

### 2. Select Payee Service

Once you have your API Key, you have to select a payee service from the catalog, to make a payment or consult.


```
# Payee Actions
- pay: The payee offers payments, though the /payments endpoint.
- balance: The payee offers consults for account balance, through the /balances endpoint
- topup: The payee offers, phone recharge packages, through the /topups endpoint
```

Example:


```
$ curl https://dev-api.finco.lat/api/v1/payees \
-H 'Authorization: Bearer your_api_key'
```

### 3. Consult Account Balance

Once you selected a payee_id, you can consult an account balance if the payee has the balance action available. This step is optional

Example:


```
curl https://dev-api.finco.lat/api/v1/balances \
-H 'Authorization: Bearer your_api_key' \
-H 'Content-Type: application/json' \
--data '{
"payee_id": "0d93acf6-b63d-46e8-aa5f-6f2520462608",
"payer_account": "055810100345"
}'
```

### 4. Make Payment

To make a payment you need the selected `payee_id`, `payer_account`, `amount` and `currency`, the `idempotency_key` is optional.

Example:


```
curl https://dev-api.finco.lat/api/v1/payments \
-H 'Authorization: Bearer your_api_key' \
-H 'Content-Type: application/json' \
--data '{
"payee_id": "0d93acf6-b63d-46e8-aa5f-6f2520462608",
"payer_account": "055810100345",
"amount": 100,
"currency": "MXN",
"idempotency_key": "client_side_idempotency_key"
}'
```

**Note:** For for infomation in each endpoint check the Finch API endpoints.