Reporting bank details
Query bank details

Query bank details

⚠️

Add test=1 to run tests without real effects. In production, omit this parameter.

Returns the bank details TGSS has on record for a contribution account (Sistema RED SLD service «Comunicación de datos bancarios») and the holder of each account: the credit balance account and the direct debit account. Read-only: nothing is changed. To change them, use Report bank details.

Parameters

  • test (number (1)) : For testing, add the test=1 parameter. It must be omitted in production.
  • regimen (integer) : Scheme, 4 digits. Possible values:
  • ccc (integer) : Contribution account code, 11 digits.
  • authorized_num (integer) : Optional, RED authorised number. Mandatory when the certificate has more than one RED authorisation; if you don't know it, send the request without it and read data.authorized_list from the 422 response. Then send it again.
GET /datos-bancarios
{
  "test": 1,
  "regimen": "0111",
  "ccc": "28123456789"
}

OK response

  • saldo_acreedor / cargo_en_cuenta (object or null) : Each account, normalised. null if the contribution account has none on record.
    • iban (string) : Full IBAN (24 characters).
    • pais_dc, entidad, sucursal, dc, cuenta (string) : The IBAN parts (country + check digits, bank, branch, check digits, account number).
    • titular (object) : Account holder.
      • tipo (string) : Document type (1 DNI, 2 Passport, 3 EU Resident Card, 4 Residence and Work Permit, 6 NIE, 9 No document / company NIF, L, M, T).
      • identificacion (string) : Holder's document, as returned by TGSS.
      • nombre (string) : Holder's name or company name.
  • datos_bancarios (object) : The full TGSS screen, with its original field names (authorised party and company names, the CrtrTbSaldoAcreedor and CrtrTbCargoEnCuenta tables, S/N flags…).
Respuesta
{
    "success": true,
    "message": "",
    "status": 200,
    "data": {
        "saldo_acreedor": {
            "iban": "ES9121000418450200051332",
            "pais_dc": "ES91",
            "entidad": "2100",
            "sucursal": "0418",
            "dc": "45",
            "cuenta": "0200051332",
            "titular": {
                "tipo": "9",
                "identificacion": "0B12345678",
                "nombre": "EMPRESA DE PRUEBA SL"
            }
        },
        "cargo_en_cuenta": {
            "iban": "ES9121000418450200051332",
            "pais_dc": "ES91",
            "entidad": "2100",
            "sucursal": "0418",
            "dc": "45",
            "cuenta": "0200051332",
            "titular": {
                "tipo": "9",
                "identificacion": "0B12345678",
                "nombre": "EMPRESA DE PRUEBA SL"
            }
        },
        "datos_bancarios": {
            "nombreAutorizado": "AUTORIZADO DE PRUEBA",
            "razonSocialAut": "DESPACHO DE PRUEBA SL",
            "razonSocialEmp": "EMPRESA DE PRUEBA SL",
            "ipfEmp": "90B123456780100",
            "CrtrTbSaldoAcreedor": {
                "codPaisDcAcreedor": "ES91",
                "codSucursalAcreedor": "0418",
                "codEntidadAcreedor": "2100",
                "digControlCuentaAcreedor": "45",
                "numCuentaAcreedor": "0200051332",
                "tipoAcreedor": "9",
                "titularCuentaAcreedor": "0B12345678",
                "nombreTitularAcreedor": "EMPRESA DE PRUEBA SL"
            },
            "CrtrTbCargoEnCuenta": {
                "codPaisDcCargoEnCuenta": "ES91",
                "codSucursalCargoEnCuenta": "0418",
                "codEntidadCargoEnCuenta": "2100",
                "digControlCuentaCargoEnCuenta": "45",
                "numCuentaCargoEnCuenta": "0200051332",
                "tipoCargoEnCuenta": "9",
                "titularCuentaCargoEnCuenta": "0B12345678",
                "nombreTitularCargoEnCuenta": "EMPRESA DE PRUEBA SL"
            },
            "indicadorSaldoAcreedor": "S",
            "indicadorCargoCuenta": "S"
        }
    }
}

Status 422 response (several authorisations)

Respuesta
{
    "success": false,
    "message": "Es obligatorio introducir el autorizado {authorized_num}",
    "status": 422,
    "data": {
        "authorized_list": [
            { "numero": "1020", "razSoc": "EMPRESA SL" },
            { "numero": "1021", "razSoc": "OTRA EMPRESA SL" }
        ]
    }
}