Mit der Schnittstelle zu LINA Voucher Online Gutscheine kann jedes konfigurierte System Gutscheine verkaufen, prüfen oder einlösen. Ist die Schnittstelle konfiguriert, greifen diese Funktionalitäten direkt auf LINA Voucher zu.


Gutschein validieren ("checkcode")

Mit der "Checkcode" Funktion wird die Gültigkeit eines Gutscheins validiert, den aktuelle Restwert und das Ablaufdatum abgefragt.



Function „checkcode“ [POST]


URL  .../extern/tokenapi/checkcode
Parameters
hash [String] Hash from previous login request
code   [String] The token code to check



Response „checkcode“
Codes 200 Request successful 400 Error during request Fields
status  "OK" Request successful "error" Requested failed, see "response" for reason
response Upon error, contains the exact error text
token "Valid" The supplied Token code is valid
"Invalid" Token code is invalid
tokencode The (nicely) formatted token code startwert Original token value in €
restwert Remaining token value in €
tokengueltig Date until when the token is valid
Format dd.mm.yyyy
tokencomplete Can the token be redeemed in parts of completly
0 = You can redeem parts
1 = You can only redeem the complete value

zurück zum Inhaltsverzeichnis

Gutschein einlösen ("redeem")

Mit der Funktion "redeem" werden Gutscheine eingelöst. Wegen besonderer Sicherheitsrisiken, werden hierfür spezielle Berechtigungen in LINA Voucher benötigt. 



Function „redeem“ [POST]

URL
 .../extern/tokenapi/redeem 
Parameters
hash [String] Hash from previous login request
code The code for the token to be redeemed
amount   [Float] Value you want to redeem from the token.



Response „redeem“
Codes 200 Request successful 400   Error during request Fields
status  "OK" Request successful "error" Requested failed, see "response" for reason
response
Upon error, contains the exact error text
token 
"Valid" The supplied Token code is valid
"Invalid" Token code is invalid
resp "OK" Amount has been redeemed "Err" Error trying to redeem, see „msg“
msg Error description from "resp" as string amount_old    Value of the token before redeeming amount_new    Value of the token after redeeming



Der Status "OK" bedeutet nur, dass die Anfrage erfolgreich beim Server empfangen wurde. Er gibt keine Information über den laufenden Prozess der Einlösung oder Reduzierung von angefragten Gutschein.

Der tatsächliche Erfolg wird im Feld "resp" geliefert.

zurück zum Inhaltsverzeichnis

Gutschein verkaufen ("purchase")

Mit der Funktion "purchase" werden LINA Gutscheine verkauft. Wegen besonderer Sicherheitsrisiken, werden hierfür spezielle Berechtigungen in LINA Voucher benötigt. 

Der Verkauf eines Gutscheins löst im Backend den gleichen Prozess aus wie der persönliche Verkauf eines Gutscheins. Der Wert und der Bezahlvorgang müssen durch den Kunden selbst vorgenommen werden. 



Function „purchase“ [POST]


URL  .../extern/tokenapi/purchase
Parameters
hash [String] Hash from previous login request
amount [Float] Value of token to be created
sendmail   [String] An email address, where the token should be sent – this value is optional
tokens   [String] The hash of the template to be used – you can find this in your Token backend
layout   [Integer] The layout ID to be used for this token. Make sure this layout is assigned to the tokens ID from above in your backend. This value is optional
tokenfrom [String] From whom this token is (only for layout > 0)
tokenfor [String] For whom this token is (only for layout > 0)



Response „purchase“ 

Codes 200 Request successful 400 Error during request Fields
status
  "OK" Request successful "error" Requested failed, see "response" for reason
response   Upon error, contains the exact error text
code The token code for the created token
amount Value for the created token
qrcode Base64-decoded string of the token code
layouthttp http-link to the generated token, if layout > 0


zurück zum Inhaltsverzeichnis