Cloud Api
Version 1.0.0.2020091116
The Select Pi Cloud Api allows vendors to integrate their applications with the Select Pi Plus platform. The Api is an internet facing restful endpoint.
To get started Leisure Design Systems (LDS) will provide the following for information per vendor.
To make a call to Api’s methods the application must first get a token. A token can be retrieved by calling the token-get api. The received token must be passed to the Api’s method in the request Authorization header value. The token is only valid for 30 seconds.
Methods
token-get
Used to authenticate requestor and returns a token to use in other api calls. Token is valid for 30 seconds.
Request parameters
TenantId | Required | Vendor’s identifier provided by LDS |
Username | Required | Vendor’s username provided by LDS |
Passkey | Required | Vendor’s password provided by LDS |
Role | Required | The role to use for functional method calls. For application integration this will generally be the Vendor Role provided by LDS. |
Sample request body
{
"TenantId": "976d7cea-2451-4304-b26d-84fd03fb72c4",
"Username": "vendor",
"Passkey": "somepassword",
"Role": "vendor-u0Co7b84zy"
}
Curl example
curl --location --request POST 'https://us-central1-lds-prod.cloudfunctions.net/selectcloud/api/v1/token-get' \
--header 'Content-Type: application/json' \
--data-raw '{
"TenantId": "976d7cea-2451-4304-b26d-84fd03fb72c4",
"Username": "vendor",
"Passkey": "somepassword",
"Role": "vendor-u0Co7b84zy"
}'
The pin code methods allow vendor applications to manage pin codes customers can use at kiosks.
Methods
pin-generate
pin-generate-custom
pin-get
pin-cancel
pin-used
Creates a new pin code for a specified bucket size. The ball count and pricing is pulled from the information setup in the Select Administrator application.
Request parameters
BucketSize | Required | Bucket size to purchase (small, medium, large, or king) |
User | Required | The user that requested the pin code |
TransactionId | Optional | Used for tracking purposes. If no value is passed in a transaction id will automatically be generated. |
ExcludeLeadingZero | Optional | Default is false. Set to true if pin code should not start with zero (‘0’) |
Response values
Expiration | The date/time in GMT the pin code will expire |
BucketSize | The size of bucket (small, medium, large, or king) |
Balls | The number of balls to be dispensed for this pin code |
ChargeAmount | The price of bucket setup in Select Administrator. |
PinCode | The pin code to be used at kiosk |
QrPinCode | The pin code text to be converted to a QR code that can be used at the kiosk |
TransactionId | The transaction id for this pin code generation. Used for tracking. |
Id | Unique identifier of this instance of pin code. |
Sample request body
{
"BucketSize" : "small",
"User": "Mike Cashier",
"TransactionId" : "vendor00001",
"ExcludeLeadingZero" : "false"
}
Sample response body
{
"Expiration": "Wed, 23 Sep 2020 18:26:46 GMT",
"BucketSize": "small",
"Balls": 55,
"ChargeAmount": 5,
"PinCode": "2784",
"QrPinCode": "[PIN]2784",
"TransactionId": "vendor00001",
"Id": 1600799206101
}
Curl example
curl --location --request POST 'https://us-central1-lds-prod.cloudfunctions.net/selectcloud/api/v1/pin-generate' \
--header 'Authorization: Bearer {TokenGoesHere}' \
--header 'Content-Type: application/json' \
--data-raw '{
"BucketSize" : "small",
"User": "Mike Cashier",
"TransactionId" : "vendor00001",
"ExcludeLeadingZero" : "false"
}'
Creates a new pin code for a custom bucket size. The ball count and pricing is passed in as parameters.
Request parameters
User | Required | The user that requested the pin code |
Balls | Required | The number of balls to dispense. min 1, max 200 |
Price | Required | The price of bucket sale. For reporting purposes. |
Expiration | Optional | Specify the date/time in GMT the pin code will expire. If not passed in will default to settings from Select Administrator. |
TransactionId | Optional | Used for tracking purposes. If no value is passed in a transaction id will automatically be generated. |
ExcludeLeadingZero | Optional | Default is false. Set to true if pin code should not start with zero (‘0’) |
Response values
Expiration | The date/time in GMT the pin code will expire |
BucketSize | The size of bucket (custom) |
Balls | The number of balls to be dispensed for this pin code |
ChargeAmount | The price of bucket setup in Select Administrator. |
PinCode | The pin code to be used at kiosk |
QrPinCode | The pin code text to be converted to a QR code that can be used at the kiosk |
TransactionId | The transaction id for this pin code generation. Used for tracking. |
Id | Unique identifier of this instance of pin code. |
Sample request body
{
"User": "Mike Cashier",
"Balls": 100,
"Price" : 20.0,
"TransactionId" : "vendor00001",
"ExcludeLeadingZero" : "false",
"Expiration" : "Wed, 23 Sep 2020 1:00:00 GMT"
}
Sample response body
{
"Expiration": "Wed, 23 Sep 2020 1:00:00 GMT",
"BucketSize": "custom",
"Balls": 55,
"ChargeAmount": 5,
"PinCode": "2784",
"QrPinCode": "[PIN]2784",
"TransactionId": "vendor00001",
"Id": 1600799206101
}
Curl example
curl --location --request POST 'http://localhost:5001/lds-prod/us-central1/selectcloud/api/v1/pin-generate-custom' \
--header 'Authorization: Bearer {TokenGoesHere}' \
--header 'Content-Type: application/json' \
--data-raw '{
"User": "Mike Cashier",
"Balls": 100,
"Price" : 20.0,
"TransactionId" : "vendor00001",
"ExcludeLeadingZero" : "false",
"Expiration" : "Wed, 23 Sep 2020 1:00:00 GMT"
}'
Retrieves information about a pin code. If the pin code has been used or cancelled no information will be returned. Only unused pin codes are returned.
Request parameters
Pincode | Required | The pin code to retrieve |
Response values
Expiration | The date/time in GMT the pin code will expire |
BucketSize | The size of bucket (small, medium, large, or king) |
Balls | The number of balls to be dispensed for this pin code |
ChargeAmount | The price of bucket setup in Select Administrator. |
PinCode | The pin code to be used at kiosk |
QrPinCode | The pin code text to be converted to a QR code that can be used at the kiosk |
TransactionId | The transaction id for this pin code generation. Used for tracking. |
Id | Unique identifier of this instance of pin code. |
Sample request body
{
" Pincode": 2784
}
Sample response body
{
"Expiration": "Wed, 23 Sep 2020 18:26:46 GMT",
"BucketSize": "small",
"Balls": 55,
"ChargeAmount": 5,
"PinCode": "2784",
"QrPinCode": "[PIN]2784",
"TransactionId": "vendor00001",
"Id": 1600799206101
}
Curl example
curl --location --request POST 'https://us-central1-lds-prod.cloudfunctions.net/selectcloud/api/v1/pin-get' \
--header 'Authorization: Bearer {TokenGoesHere}' \
--header 'Content-Type: application/json' \
--data-raw '{
"Pincode": 2784
}'
Used to cancel a pin code. Will return success whether pin code was valid or not.
Request parameters
Pincode | Required | The pin code to cancel |
User | Required | User requesting to cancel pin code |
Sample request body
{
"Pincode": 2784,
"User": "Mike Cashier"
}
Curl example
curl --location --request POST 'https://us-central1-lds-prod.cloudfunctions.net/selectcloud/api/v1/pin-cancel' \
--header 'Authorization: Bearer {TokenGoesHere}' \
--header 'Content-Type: application/json' \
--data-raw '{
"Pincode": 2784,
"User": "Mike Cashier"
}'
Used to mark a pin code as used. Will return success whether pin code was valid or not.
Request parameters
Pincode | Required | The pin code to cancel |
Sample request body
{
"Pincode": 2784,
}
Curl example
curl --location --request POST 'https://us-central1-lds-prod.cloudfunctions.net/selectcloud/api/v1/pin-use' \
--header 'Authorization: Bearer {TokenGoesHere}' \
--header 'Content-Type: application/json' \
--data-raw '{
"Pincode": 2784
}'
The Api may return error codes to help the vendor application handle error scenarios. The error codes are returned as the response status code.
Error Code | Error Message |
509 | Service side error. Contact support. |
510 | Access not allowed |
511 | Role does not have access to api |
520 | Invalid parameters |
530 | Data not found |
531 | User not found |
541 | Pin code does not exists |
542 | Pin code expired |
543 | Could not find free pin code |
544 | Invalid bucket size |
Leisure Design Systems, Inc.