Contents

GET [/instances/$INSTANCE]/private/otp-devices/$DEVICE_ID#

This is used to obtain detailed information about a specific OTP device.

The client can provide additional inputs in the query to allow the backend to compute and return a sample OTP code. Note that it is not an error if the client provides query arguments that are not being used or that are insufficient for the server to compute the otp_code: If the client provides inadequate query parameters, the otp_code is simply omitted from the response.

Required permission: otp-devices-read

Query:

Query Parameters:
  • faketime=TIMESTAMPOptional. Timestamp in seconds to use when calculating the current OTP code of the device. Since protocol v10.

  • price=AMOUNTOptional. Price to use when calculating the current OTP code of the device. Since protocol v10.

Response:

200 OK:

The backend has successfully returned the detailed information about a specific OTP device. Returns a OtpDeviceDetails.

404 Not found:

The OTP device or instance is unknown to the backend.

Details:

 interface OtpDeviceDetails {

   // Human-readable description for the device.
   device_description: string;

   // Algorithm for computing the POS confirmation.
   //
   // Currently, the following numbers are defined:
   // 0: None
   // 1: TOTP without price
   // 2: TOTP with price
   otp_algorithm: Integer;

   // Counter for counter-based OTP devices.
   otp_ctr?: Integer;

   // Current time for time-based OTP devices.
   // Will match the faketime argument of the
   // query if one was present, otherwise the current
   // time at the backend.
   //
   // Available since protocol **v10**.
   otp_timestamp: Integer;

   // Current OTP confirmation string of the device.
   // Matches exactly the string that would be returned
   // as part of a payment confirmation for the given
   // amount and time (so may contain multiple OTP codes).
   //
   // If the otp_algorithm is time-based, the code is
   // returned for the current time, or for the faketime
   // if a TIMESTAMP query argument was provided by the client.
   //
   // When using OTP with counters, the counter is **NOT**
   // increased merely because this endpoint created
   // an OTP code (this is a GET request, after all!).
   //
   // If the otp_algorithm requires an amount, the
   // amount argument must be specified in the
   // query, otherwise the otp_code is not
   // generated.
   //
   // This field is *optional* in the response, as it is
   // only provided if we could compute it based on the
   // otp_algorithm and matching client query arguments.
   //
   // Available since protocol **v10**.
   otp_code?: string;

}