Skip to content
Download OpenAPI description
Languages
Servers
Demo tenant

https://open-api-demo.devices.magicline.com/

Mock server

https://redocly.sportalliance.com/_mock/apis/magicline/deviceapi/deviceapi/

Access

Here are all the endpoints that are necessary for GenericCardReader to be successfully used. This endpoints should be used for device with model GENERIC_CARD_READER. The model can be found in response from getDevices which was already described in authentication process.

Operations

Vending

Here are all the endpoints that are necessary for GenericVending to be successfully used. This endpoints should be used for device with model GENERIC_VENDING_READER. The model can be found in response from getDevices which was already described in authentication process.

Operations
Operations

Get available intervals with prices

Request

Returns a list of available time intervals with their corresponding prices. This allows the device to display the options to the customer.

Security
ApiKeyAuth
Headers
Accept-Languagestring

More information about the header can be found here.

Example: de
curl -i -X GET \
  https://open-api-demo.devices.magicline.com/open-api/device/time/price \
  -H 'Accept-Language: de' \
  -H 'Authorization: Bearer <YOUR_oauth2_HERE>'

Responses

OK - List of available time intervals with prices

Bodyapplication/json
selectionArray of objects

List of available time intervals with their corresponding prices.

Response
application/json
{ "selection": [ {} ] }

Checks if customer is authorized to use time device

Request

You can find more information about identification here.

Security
ApiKeyAuth
Headers
Accept-Languagestring

More information about the header can be found here.

Example: de
Bodyapplication/jsonrequired
identificationanyrequired
identification.​typestringrequired
Example: "NUMBER"
Discriminator
identification.​valuestringrequired

Card number

Example: "1233588160"
identification.​formatstring

In which format the card number value was provided. All of the following examples represent the same card number

  • DECIMAL - Card number is interpreted as string of decimal numbers.
    • Example : "1173673668653440"
  • HEX_MSB - Card number is interpreted as hex string using big-endian (from most significant to least significant byte) order.
    • Example : "042b73321a3180"
  • HEX_LSB - Card number is interpreted as hex string using little-endian (from least significant to most significant byte) order.
    • Example : "80311a32732b04"
Default "DECIMAL"
Enum"DECIMAL""HEX_MSB""HEX_LSB"
curl -i -X POST \
  https://open-api-demo.devices.magicline.com/open-api/device/time/identification \
  -H 'Accept-Language: de' \
  -H 'Authorization: Bearer <YOUR_oauth2_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "identification": {
      "type": "NUMBER",
      "value": "1233588160",
      "format": "DECIMAL"
    }
  }'

Responses

OK - identification has been successfully executed you can continue with usage endpoint

Bodyapplication/json
textstring

If customer is not authorized then it contains message with reason

Example: ""
authorizedboolean

If customer is authorized then is allowed to use the device

Example: true
Response
application/json
{ "text": "", "authorized": true }

Request

This should be conducted post-identification with shouldExecuteAction = false in order to execute a dry-run, ensuring that customers can obtain the benefit, for example has contingent, etc. If this first request was successful, the benefit can be enabled. After the benefit was successfully enabled, this endpoint needs to be called again with shouldExecuteAction = true, which will subsequently lead to the customer being charged or benefit being used. You can find more information about usage here

Security
ApiKeyAuth
Headers
Accept-Languagestring

More information about the header can be found here.

Example: de
Bodyapplication/jsonrequired
identificationanyrequired
identification.​typestringrequired
Example: "NUMBER"
Discriminator
identification.​valuestringrequired

Card number

Example: "1233588160"
identification.​formatstring

In which format the card number value was provided. All of the following examples represent the same card number

  • DECIMAL - Card number is interpreted as string of decimal numbers.
    • Example : "1173673668653440"
  • HEX_MSB - Card number is interpreted as hex string using big-endian (from most significant to least significant byte) order.
    • Example : "042b73321a3180"
  • HEX_LSB - Card number is interpreted as hex string using little-endian (from least significant to most significant byte) order.
    • Example : "80311a32732b04"
Default "DECIMAL"
Enum"DECIMAL""HEX_MSB""HEX_LSB"
durationInSecondsinteger

Duration of the benefit usage in seconds.

Example: 30
shouldExecuteActionboolean

In a dry run, when the value is set to false, you will receive a validation result without customer being charged. Learn more about it here.

Default true
Example: true
curl -i -X POST \
  https://open-api-demo.devices.magicline.com/open-api/device/time/usage \
  -H 'Accept-Language: de' \
  -H 'Authorization: Bearer <YOUR_oauth2_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "identification": {
      "type": "NUMBER",
      "value": "1233588160",
      "format": "DECIMAL"
    },
    "durationInSeconds": 30,
    "shouldExecuteAction": true
  }'

Responses

OK - Usage check done

Bodyapplication/json
textstring

If customer is not authorized then it contains message with reason

Example: ""
authorizedboolean

If customer is authorized then is allowed to buy/use product

Example: true
priceobject(Money)

Represents a financial data

Response
application/json
{ "text": "", "authorized": true, "price": { "amount": 20, "currency": "EUR" } }