Server JSON API (for non-Keyple client)


The Server JSON API describes the workflow and the JSON format of data exchanged between terminal and server during a remote card transaction, as well as the corresponding business rules.

Please note that this guide does not specify the data transport layer on the network, which remains the responsibility of the user.

Workflow

The Keyple remote transaction involves four types of messages exchanged between the terminal and the server:

MessageDirectionDescription
Execute Remote ServiceTo serverAllows the terminal to request the server to start a remote ticketing transaction.
CommandFrom serverRequests the terminal to process specific services with the card or the terminal’s reader.
ResponseTo serverAllows the terminal to send to the server the responses to the services it has performed.
End Remote ServiceFrom serverTells the terminal that the remote ticketing transaction is complete.

On its own initiative (e.g. following the detection of a card), the terminal sends to the server an “Execute Remote Service” message to request it to start a card transaction. At this point, the terminal has the ability to tell the server which business service to run and also to provide the result of an already processed card selection scenario (e.g. ProcessedCardSelectionScenarioJsonString) and/or additional custom input data.

As long as the transaction is not completed, the terminal receives from the server “Command” messages containing the actions to be performed with the card or the terminal’s reader. The responses are sent to the server in “Response” messages.

When the transaction is complete, the terminal receives from the server a final “End Remote Service” message which optionally contains custom transaction output data.

The diagram below illustrates the messages exchange flow:

Keyple Server JSON API - Workflow
Keyple Server JSON API - Workflow

Message format

The following table indicates the global JSON format of each message:

MessageDirectionJSONDescription
Execute Remote ServiceTo serverMessageDtoAn object.
CommandFrom server[ MessageDto ]An array containing a single object.
ResponseTo serverMessageDtoAn object.
End Remote ServiceFrom server[ MessageDto ]An array containing a single object.

JSON specification