API Kunden Guthaben
Last updated
by
Jürgen Weisental
**API Key erstellen**
Stammdaten -> Sonstiges -> API
Api Key Typ Buchung erstellen.
**Datenstruktur**
```
public class CustomerChangeAccount {
public string CustomerId { get; set; }
public double Amount { get; set; }
public double Bonus { get; set; }
public string Comment { get; set; }
}
```
CustomerId (Feld Nr im Kundenstamm)
Amount Betrag der Aufgeladen oder Entfernt werden soll
Bonus Betrag der nicht Ausbezahlt werden kann
Commt Bemerkung des Kaufes
**Beispiel**
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{'CustomerId': 'test001','Amount': 5, 'Comment':'Aufladen 5€'}" https://demo.portal.dikas.de/rest/customer/account/change/4544324hk24zh42
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{'CustomerId': 'test001','Amount': -2.1, 'Comment':'Gutschein Kauf'}" https://demo.portal.dikas.de/rest/customer/account/change/4544324hk24zh42
**Ergebnis**
```
{ "IsOk":true,
"Message":"",
"ErrorId":0,
"Data": 5.0
}
Guthaben Reservierung
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" -d "{'CustomerId': 'test001','Amount': -5, 'Comment':'ReNr. 1234'}" https://demo.portal.dikas.de/rest/customer/account/allocation/4544324hk24zh42
**Reservierung Verwenden**
https://[onlineid].portal.dikas.de/rest/customer/account/redeem/[APIKey]/[custid]/[allocationId]
**Reservierung Abbrechen**
https://[onlineid].portal.dikas.de/rest/customer/account/cancel/[APIKey]/[custid]/[allocationId]
**Reservierung Anzeigen**
https://[onlineid].portal.dikas.de/rest/customer/account/open/[APIKey]/[custid]
Ergebnis: {
"IsOk":true,
"Message":null,
"ErrorId":0,
"Data":[
{"Date":"2019-02-25T13:23:54+01:00","BonId":"Test","Amount":5.0,"AllocationId":"yXvtaZeuREiA5WSaHEfB9A"}
]}}
·