https://github.com/obliosoftware/oblioappcsharp
Oblio.eu API implementation for C#
https://github.com/obliosoftware/oblioappcsharp
Last synced: about 1 year ago
JSON representation
Oblio.eu API implementation for C#
- Host: GitHub
- URL: https://github.com/obliosoftware/oblioappcsharp
- Owner: OblioSoftware
- License: mit
- Created: 2024-01-11T10:34:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T14:20:32.000Z (over 2 years ago)
- Last Synced: 2025-02-13T21:37:32.379Z (over 1 year ago)
- Language: C#
- Homepage: https://www.oblio.eu
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OblioAppCSharp
Oblio.eu API implementation for C#
## Create invoice
```
try {
Env env = GetEnv();
string jsonString = @"{
""cif"": """",
""client"": {
""cif"": ""19"",
""name"": ""Bucur Obor SRL"",
""phone"": ""0800900900""
},
""seriesName"": """",
""language"": ""RO"",
""precision"": 2,
""currency"": ""RON"",
""collect"": {},
""referenceDocument"": {},
""products"": [
{
""name"" : ""Abonament"",
""code"" : """",
""description"" : """",
""price"" : ""100"",
""measuringUnit"": ""buc"",
""currency"" : ""RON"",
""vatName"" : ""Normala"",
""vatPercentage"": 19,
""vatIncluded"" : true,
""quantity"" : 2,
""productType"" : ""Serviciu""
}
],
""issuerName"": ""Ion Popescu"",
""issuerId"": 1234567890123,
""noticeNumber"": """",
""internalNote"": ""Factura emisa din API"",
""deputyName"": ""George Popescu"",
""deputyIdentityCard"": ""ID 1234"",
""deputyAuto"": ""CT 12345"",
""selesAgent"": ""Marian Popescu"",
""mentions"": ""Factura de test emisa din API"",
""workStation"": ""Sediu"",
""useStock"": 0
}";
JsonNode? node = JsonNode.Parse(jsonString);
if (node == null) {
throw new Exception("Parse error jsonString");
}
JsonObject data = (JsonObject)node;
data["cif"] = env.Cif;
data["seriesName"] = env.SeriesName;
OblioApi api = new OblioApi(env.Email, env.Secret);
JsonObject response = api.CreateDoc("invoice", data);
Console.WriteLine(response["data"]!["link"]!);
} catch (Exception e) {
Console.WriteLine(e.Message);
}
```
## Nomenclature
```
try {
Env env = GetEnv();
OblioApi api = new OblioApi(env.Email, env.Secret);
api.SetCif(env.Cif);
JsonObject response = api.Nomenclature("products");
Console.WriteLine(response.ToString());
} catch (Exception e) {
Console.WriteLine(e.Message);
}
```