Inicio rápido
Obtén tus claves
Pídele a Ligo una clave de sandbox. Empieza por ligo_test_ y viene con un client_id y un client_secret, que se muestran una sola vez: guárdalos en tu gestor de secretos. Las claves en vivo llegan después, con un código de canje de un solo uso.
Obtén un token de acceso
Cambia la clave por un token de acceso que dura una hora. También puedes enviar la propia clave como bearer.
curl https://api.ligoapi.com/oauth/token \ -u "$LIGO_CLIENT_ID:$LIGO_CLIENT_SECRET" \ -d grant_type=client_credentials { "access_token": "ligo_test_at_8Kc2pQx7Vd0mZr4TnY1sWbHeLu9aFj3G", "token_type": "Bearer", "expires_in": 3600} Agrega tus cuentas
Ligo configura tu integración, tu conexión con el banco, y GET /v1/integrations te da su ID. Agrega todas las cuentas que el banco lista con las credenciales bancarias en X-Bank-Credentials. En el sandbox, test_ok devuelve los datos de prueba:
BANK_CREDENTIALS=$(printf '{"int_YUdNP6Ksih3yCEgVKy2tzg":{"api_key":"test_ok"}}' \ | base64 | tr '+/' '-_' | tr -d '=\n') curl https://api.ligoapi.com/v1/accounts \ -H "Authorization: Bearer $LIGO_ACCESS_TOKEN" \ -H "X-Bank-Credentials: $BANK_CREDENTIALS" \ -H "Content-Type: application/json" \ -d '{ "integration_id": "int_YUdNP6Ksih3yCEgVKy2tzg", "all": true }' { "data": [ { "id": "acc_WHE4iXdNcTEs4Vn-L8t7keTjCyR8mWRORj5p-LkJHedfj8zSgfYKuZk-vBqGp4RLPOA-", "integration_id": "int_YUdNP6Ksih3yCEgVKy2tzg", "entity_id": "ent_nLoIRHnCnA27JwIA_oUXBA", "bank": "sandbox", "number": "0399994821130", "type": "checking", "currency": "USD", "source": "api", "enabled": true, "refresh_interval_minutes": 240, "created_at": "2026-11-11T15:04:05.123Z", "updated_at": "2026-11-11T15:04:05.123Z" }, { "id": "acc_Gl6D6C_lAlrga_xKl3Vuboi8Mz8-LLZoFC6C6WDo_Z_jfgLGjO8YyqTDQuxoUjc8a5Lq", "integration_id": "int_YUdNP6Ksih3yCEgVKy2tzg", "entity_id": "ent_nLoIRHnCnA27JwIA_oUXBA", "bank": "sandbox", "number": "0399994821131", "type": "savings", "currency": "USD", "source": "api", "enabled": true, "refresh_interval_minutes": 240, "created_at": "2026-11-11T15:04:05.123Z", "updated_at": "2026-11-11T15:04:05.123Z" } ]} Actualiza saldos y movimientos
Ligo trae del banco el último saldo y los movimientos de los últimos 31 días, y los guarda:
BANK_CREDENTIALS=$(printf '{"int_YUdNP6Ksih3yCEgVKy2tzg":{"api_key":"test_ok"}}' \ | base64 | tr '+/' '-_' | tr -d '=\n') curl https://api.ligoapi.com/v1/accounts/refresh \ -H "Authorization: Bearer $LIGO_ACCESS_TOKEN" \ -H "X-Bank-Credentials: $BANK_CREDENTIALS" \ -H "Content-Type: application/json" \ -d '{ "all": true }' { "data": [ { "id": "acc_WHE4iXdNcTEs4Vn-L8t7keTjCyR8mWRORj5p-LkJHedfj8zSgfYKuZk-vBqGp4RLPOA-", "integration_id": "int_YUdNP6Ksih3yCEgVKy2tzg", "entity_id": "ent_nLoIRHnCnA27JwIA_oUXBA", "bank": "sandbox", "number": "0399994821130", "type": "checking", "currency": "USD", "source": "api", "enabled": true, "refresh_interval_minutes": 240, "refreshed": true, "created_at": "2026-11-11T15:04:05.123Z", "updated_at": "2026-11-11T15:04:05.123Z", "balance": { "type": "interim_booked", "amount": { "value": "1250.00", "currency": "USD" }, "credit_debit": "credit", "date": "2026-11-15", "fetched_at": "2026-11-15T14:32:09.418Z" } } ]} Lee los movimientos
Lee los movimientos guardados por fecha contable, una página a la vez. Esto nunca llama al banco:
curl "https://api.ligoapi.com/v1/transactions?account_id=acc_WHE4iXdNcTEs4Vn-L8t7keTjCyR8mWRORj5p-LkJHedfj8zSgfYKuZk-vBqGp4RLPOA-&from=2026-11-14&to=2026-11-15&limit=2" \ -H "Authorization: Bearer $LIGO_ACCESS_TOKEN" { "data": [ { "id": "txn_3f9a1c07be5d42e8a6c0d1b97e4f2a55", "account_id": "acc_WHE4iXdNcTEs4Vn-L8t7keTjCyR8mWRORj5p-LkJHedfj8zSgfYKuZk-vBqGp4RLPOA-", "status": "booked", "credit_debit": "credit", "amount": { "value": "1250.00", "currency": "USD" }, "booking_date": "2026-11-14", "value_date": "2026-11-14", "description": "Invoice 1042 payment", "references": [{ "type": "invoice", "value": "1042" }], "balance_after": { "amount": { "value": "6410.25", "currency": "USD" }, "credit_debit": "credit" }, "source": "api" }, { "id": "txn_b2d6e4810c3a47f9915e7a0d6c8f3b12", "account_id": "acc_WHE4iXdNcTEs4Vn-L8t7keTjCyR8mWRORj5p-LkJHedfj8zSgfYKuZk-vBqGp4RLPOA-", "status": "booked", "credit_debit": "debit", "amount": { "value": "86.40", "currency": "USD" }, "booking_date": "2026-11-14", "description": "Office supplies", "source": "api" } ], "next_cursor": "eyJ2IjoxLC…"}