Giter Club home page Giter Club logo

viseca-exporter's Introduction

viseca-exporter

Little helper to get transactions from Viseca One and print them in CSV format.

Usage

While the "auth w/o browser" method is a very comfortable way to get the transactions, it has a higher risk to error due to changes to the auth flow of Viseca One. If it fails, try the "auth w/ browser" method.

Auth w/o browser

This method processes the auth flow in the CLI and will trigger a 2FA request like the login in a browser would.

  1. Log in to one.viseca.ch

  2. Go to "Transaktionen" on one.viseca.ch

  3. Save the card ID from the path (between /v1/card/ and /transactions)

  4. export VISECA_CLI_USERNAME=<email>
    export VISECA_CLI_PASSWORD=<password>
    go run cmd/viseca-cli/main.go transactions <cardID>
    

Auth w/ browser

This method requires a valid session cookie obtained from an authenticated browser session.

  1. Log in to one.viseca.ch

  2. Open the developer tools of your browser and navigate to the network tab

  3. Go to "Transaktionen" on one.viseca.ch

  4. Filter the URLs in the network tab of the developer tools for transactions

  5. Save the card ID from the path (between /v1/card/ and /transactions) to an env file (see examples)

  6. Save the session cookie (AL_SESS-S=AAAAAA...) to an env file (see examples)

  7. source .env
    go run main.go "$CARDID" "$COOKIE" > data/export.csv
    

Example Output

"TransactionID","Date","Merchant","Amount","PFMCategoryID","PFMCategoryName"
"AUTH8c919db2-1c23-43f1-8862-61c31336d9b6","2021-10-20T17:05:44","ALDI","50.550000","cv_groceries","Groceries"

API

Known issues

The API returns 500 Internal Server Error without any additional information when a request doesn't meet the API requirements.

Large page sizes (e.g. 1000) lead to an error.

API Output

{
    "totalCount": 1,
    "list": [
        {
            "transactionId": "AUTH8c919db2-1c23-43f1-8862-61c31336d9b6",
            "cardId": "0000000AAAAA0000",
            "maskedCardNumber": "XXXXXXXXXXXX0000",
            "cardName": "Mastercard",
            "date": "2021-10-20T17:05:44",
            "showTimestamp": true,
            "amount": 50.55,
            "currency": "CHF",
            "originalAmount": 50.55,
            "originalCurrency": "CHF",
            "merchantName": "Aldi Suisse 00",
            "prettyName": "ALDI",
            "merchantPlace": "",
            "isOnline": false,
            "pfmCategory": {
                "id": "cv_groceries",
                "name": "Lebensmittel",
                "lightColor": "#E2FDD3",
                "mediumColor": "#A5D58B",
                "color": "#51A127",
                "imageUrl": "https://api.one.viseca.ch/v1/media/categories/icon_with_background/ic_cat_tile_groceries_v2.png",
                "transparentImageUrl": "https://api.one.viseca.ch/v1/media/categories/icon_without_background/ic_cat_tile_groceries_v2.png"
            },
            "stateType": "authorized",
            "details": "Aldi Suisse 00",
            "type": "merchant",
            "isBilled": false,
            "links": {
                "transactiondetails": "/v1/card/0000000AAAAA0000/transaction/AUTH8c919db2-1c23-43f1-8862-61c31336d9b6"
            }
        }
    ]
}

viseca-exporter's People

Contributors

anothertobi avatar renovate[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.