https://github.com/obliosoftware/oblioapijava
Oblio.eu API implementation for Java
https://github.com/obliosoftware/oblioapijava
Last synced: 12 months ago
JSON representation
Oblio.eu API implementation for Java
- Host: GitHub
- URL: https://github.com/obliosoftware/oblioapijava
- Owner: OblioSoftware
- License: mit
- Created: 2024-01-02T07:18:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T14:31:09.000Z (over 2 years ago)
- Last Synced: 2025-03-31T16:25:27.000Z (about 1 year ago)
- Language: Java
- Homepage: https://www.oblio.eu
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OblioApiJava
Oblio.eu API implementation for Java
## Create invoice
```
try {
Dotenv env = Dotenv.configure()
.directory("assets")
.load();
JSONArray products = new JSONArray()
.put(new JSONObject()
.put("name", "Abonament")
.put("code", "")
.put("description", "")
.put("measuringUnit", "buc")
.put("currency", "RON")
.put("vatName", "Normala")
.put("vatPercentage", 19)
.put("vatIncluded", true)
.put("quantity", 2)
.put("productType", "Serviciu")
.put("price", 100)
);
JSONObject data = new JSONObject()
.put("cif", env.get("CIF"))
.put("client", new JSONObject()
.put("cif", "RO19")
.put("name", "BUCUR OBOR")
.put("code", "")
.put("state", "Bucuresti")
.put("city", "Sector 2")
)
.put("seriesName", env.get("SERIES_NAME"))
.put("products", products);
System.out.println(data.toString());
OblioApi api = new OblioApi()
.setEmail(env.get("API_EMAIL"))
.setSecret(env.get("API_SECRET"))
.build();
JSONObject result = api.createDoc("invoice", data);
System.out.println(result.toString());
} catch (Exception e) {
System.out.println(e.getMessage());
}
```
## Nomenclature
```
try {
Dotenv env = Dotenv.configure()
.directory("assets")
.load();
OblioApi api = new OblioApi()
.setEmail(env.get("API_EMAIL"))
.setSecret(env.get("API_SECRET"))
.setCif(env.get("CIF"))
.build();
JSONObject result = api.nomenclature("products", new HashMap());
System.out.println(result.toString());
} catch (Exception e) {
System.out.println(e.getMessage());
}
```