Skip to content

asello client api - library to control asello within an iframe

License

Notifications You must be signed in to change notification settings

asello/asello-client-api

Repository files navigation

asello ClientApi

asello client api - a library to control asello within an iframe

More information about asello and the asello clientapi could be found on the website: https://asello.at/entwickler-api/

Getting started

  1. Create an iframe in your web application.

  2. Create an asello client with the iframe selector.

var api = new AselloClientAPIClient("#aselloframe", "https://kassa.asello.at")
  1. Get an access token from the webserver

OAuth Token Endpoint: https://kassa.asello.at/token

API Description

The asello client api offers following methods:

Create Invoice

Create a new invoice in asello

Example:

api.create({
        access_token: token,
        action: 'print',
        data: {
            "items": [{
                "name": "Produkt 1",
                "description": "Meine Beschreibung",
                "netprice": 20,
                "vatcode": "A",
                "quantity": 2
            }]
        },
        autoLogoff: false
    }, function(result) {
        // alert("The invoice number is '" + result.number + "'")
    });

Open Details

Example:

api.openDetails({
    access_token: token,
    number: 123456789
});

Cancel Invoice

Example:

api.cancel({
    access_token: token,
    print: true,
    invoiceid: 123456789,
    reason: 'reason',
    internal_note: 'internal_note'
}, function(result, err) {
    /*
    if(err) {
        alert("Error " + err.message)
        return;
    }

    alert("The invoice number is '" + result.number + "' with id " + result.id)
    */
});

For more examples please visit https://asello.at/entwickler-api/entwickler-playground/.

Start the sample

Prerequirement

Install the dependencies and start the webserver (execute following commands in a terminal window).

npm install
bower install
npm start

Open a webbrowser to http://localhost:8080

Need Help?

Get in touch with the asello team (support@asello.at).

About

asello client api - library to control asello within an iframe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published