> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fintoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Legacy v2023-11-15 quickstart for Fintoc's Transfers API: generate API keys, send your first test transfer, and subscribe to webhook events end to end.

To send a test transfer with Fintoc's Transfers API, create an account in the [Dashboard](https://dashboard.fintoc.com/) and complete these steps:

1. Get your test API keys.
2. Generate your JWS keys and upload them to the Dashboard.
3. Get your accounts.
4. Send your first transfer.

# Step 1: Get your test API keys

Authenticate every interaction with the Fintoc API using your [API keys](/v2023-11-15/guides/home/api-keys). Fintoc returns an error when a request omits the API key or uses an incorrect one.

Every Fintoc account has two pairs of API keys: one for [`test` mode](/v2023-11-15/guides/resources/test-mode) and one for `live` mode. Each resource belongs to one mode. You cannot use a key from one mode to manage resources in the other.

Sign up in the [Dashboard](https://dashboard.fintoc.com/) to create your Fintoc account and get your API keys. For this guide, use the **Secret Key** for `test` mode. Its `sk_test_` prefix identifies the key's mode.

# Step 2: Register your JWS keys

To call Transfers **endpoints that move money**, include a JSON Web Signature (JWS). The signature protects the integrity and authenticity of the request data.

To register your JWS keys, follow [this guide](/v2023-11-15/guides/transfers/setting-up-jws-keys#generate-jws-keys).

# Step 3: Get your accounts

Use your `test` **Secret Key** to list your accounts through the API:

```bash cURL theme={null}
curl --request GET \
     --url https://api.fintoc.com/v2/accounts \
     --header 'Authorization: sk_test_9c8d8CeyBTx1VcJzuDgpm4H' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'
```

The response should look like this:

```json JSON theme={null}
[
  {
    "id": "acc_23JlasHas241",
    "object": "account",
    "mode": "test",
    "description": "My root account",
    "root_account_number": "000000000000000000",
    "root_account_number_id": "acno_Kasf91034gj1AD",
    "available_balance": 0,
    "currency": "MXN",
    "entity": {
      "id": "ent_4324qwkalsds",
      "holder_name": "ACME Inc.",
      "holder_id": "ND"
    }
  }
]
```

## Use an SDK

Install the [Python SDK](https://github.com/fintoc-com/fintoc-python) or [Node SDK](https://github.com/fintoc-com/fintoc-node) to interact with the API. Both SDKs [generate the JWS signature](/v2023-11-15/guides/transfers/setting-up-jws-keys) and handle pagination.

First, install an SDK:

```bash Install Python SDK theme={null}
pip install fintoc
```

```bash Install Node SDK theme={null}
npm install fintoc
```

Now list your accounts:

```python theme={null}
from fintoc import Fintoc

# You can provide a path to your PEM file or pass the PEM key directly as a string.
# jws_private_key = os.environ.get('JWS_PRIVATE_KEY')
jws_private_key = "./private_key.pem"

client = Fintoc("your_api_key", jws_private_key=jws_private_key)

for account in client.v2.accounts.list():
  print(account.id, account.description, account.root_account_number, account.available_balance)

```

```javascript Node theme={null}
const { Fintoc } = require('fintoc');

// You can provide a path to your PEM file or pass the PEM key directly as a string.
// const privateKey = process.env.JWS_PRIVATE_KEY;
const privateKey = './private_key.pem';

const fintoc = new Fintoc('your_api_key', privateKey);

const accounts = await fintoc.v2.accounts.list();
for await (const account of accounts) {
  console.log(account.id, account.description, account.root_account_number);
}
```

# Step 4: Make your first transfer

Now create a transfer. In `live` mode, the transfer moves money to your customer's account. In `test` mode, the transfer uses the same API without moving money.

## Fund your test account

Your `test` account starts without funds, as does your `live` account. To add funds, simulate a transfer through the API or the dashboard.

## Make an outbound transfer

First, sign your transfer request with a JWS. Follow the [JWS signature guide](/v2023-11-15/guides/transfers/setting-up-jws-keys#generate-jws-signature) to generate the signature.

Use the JWS signature and the `account_id` from Step 3 to create a transfer of \$590.13 MXN:

```bash theme={null}
curl --request POST \
     --url https://api.fintoc.com/v2/transfers \
     --header 'Authorization: YOUR_API_KEY' \
     --header 'Fintoc-JWS-Signature: YOUR_JWS_SIGNATURE' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "amount": 59013,
  "currency": "MXN",
  "account_id": "acc_M8sKf230BgHjD4",
  "comment": "Pago de credito 10451",
  "reference_id": "150195",
  "counterparty": {
    "account_number": "000000000000000000"
  }
}'
```

<Warning>
  **Currencies are represented as integers**

  The Fintoc API represents amounts as integers in the smallest currency unit. For example, represent MXN \$590.13 as `59013`.

  The Chilean peso has no minor unit. To transfer \$59,013 CLP, set `amount` to `59013`.

  Read more about [currencies](/v2023-11-15/guides/home/currencies).
</Warning>

## Use an SDK

Create the transfer with an SDK:

```python theme={null}
transfer = client.v2.transfers.create(
    amount=59013,
    currency="MXN",
    account_id="acc_M8sKf230BgHjD4",
    comment="Pago de credito 10451",
    reference_id="150195",
    counterparty={"account_number": "000000000000000000"},
)
```

```javascript Node theme={null}
const transfer = await fintoc.v2.transfers.create({
  amount: 59013,
  currency: 'MXN',
  account_id: 'acc_M8sKf230BgHjD4',
  comment: 'Pago de credito 10451',
  reference_id: '1234124',
  counterparty: {
      account_number: '000000000000000000',
  },
});
```

You created your first transfer. For production integrations, consider these features:

* Use idempotency keys to repeat requests without creating duplicate objects.
* Use [account numbers](/v2023-11-15/guides/transfers/transfers-overview/v2-transfers-account-number-data-model) to reconcile incoming transfers.
* Add metadata to attach custom data to your Fintoc objects.

Learn more in the guides for [receiving transfers](/v2023-11-15/guides/transfers/inbound-transfers) and [sending transfers](/v2023-11-15/guides/transfers/outbound-transfers). For transfer concepts, read the [transfers overview](/v2023-11-15/guides/transfers/transfers-overview).
