Card number
Device API
https://open-api-demo.devices.magicline.com/
https://redocly.sportalliance.com/_mock/apis/magicline/deviceapi/deviceapi/
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"
- Example :
HEX_MSB
- Card number is interpreted as hex string using big-endian (from most significant to least significant byte) order.- Example :
"042b73321a3180"
- Example :
HEX_LSB
- Card number is interpreted as hex string using little-endian (from least significant to most significant byte) order.- Example :
"80311a32732b04"
- Example :
- Demo tenant
https://open-api-demo.devices.magicline.com/open-api/device/vending/identification
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/deviceapi/deviceapi/open-api/device/vending/identification
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://open-api-demo.devices.magicline.com/open-api/device/vending/identification \
-H 'Accept-Language: de' \
-H 'Authorization: Bearer <YOUR_oauth2_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"identification": {
"type": "NUMBER",
"value": "1233588160",
"format": "DECIMAL"
},
"transactionId": "4671fde7-bb07-4fe5-aa0e-947d9ccb842f"
}'
OK - identification has been successfully executed you can continue with sale endpoint
{ "text": "", "authorized": true, "consumptionCredit": 6.4, "transactionId": "4671fde7-bb07-4fe5-aa0e-947d9ccb842f" }
Request
This should be conducted post-identification with shouldExecuteAction = false
in order to execute a dry-run, ensuring that customers can obtain the product, for example has enough credit, etc. If this first request was successful, the product can be dispensed. After the product was sucessfully dispensed, this endpoint needs to be called again with shouldExecuteAction = true
, which will subsequently lead to the customer being charged. You can find more information about sale here
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"
- Example :
HEX_MSB
- Card number is interpreted as hex string using big-endian (from most significant to least significant byte) order.- Example :
"042b73321a3180"
- Example :
HEX_LSB
- Card number is interpreted as hex string using little-endian (from least significant to most significant byte) order.- Example :
"80311a32732b04"
- Example :
Unique ID of the transaction (you have to generate it)
Price of the product according to vending machine. If the price is different than in Magicline then the request will be rejected
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.
- Demo tenant
https://open-api-demo.devices.magicline.com/open-api/device/vending/sale
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/deviceapi/deviceapi/open-api/device/vending/sale
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://open-api-demo.devices.magicline.com/open-api/device/vending/sale \
-H 'Accept-Language: de' \
-H 'Authorization: Bearer <YOUR_oauth2_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"identification": {
"type": "NUMBER",
"value": "1233588160",
"format": "DECIMAL"
},
"transactionId": "4671fde7-bb07-4fe5-aa0e-947d9ccb842f",
"productId": "1",
"price": 1.29,
"shouldExecuteAction": true
}'
{ "text": "", "authorized": true, "consumptionCredit": 6.4, "transactionId": "4671fde7-bb07-4fe5-aa0e-947d9ccb842f", "price": 1.29 }
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"
- Example :
HEX_MSB
- Card number is interpreted as hex string using big-endian (from most significant to least significant byte) order.- Example :
"042b73321a3180"
- Example :
HEX_LSB
- Card number is interpreted as hex string using little-endian (from least significant to most significant byte) order.- Example :
"80311a32732b04"
- Example :
Unique ID of the transaction (you have to generate it)
- Demo tenant
https://open-api-demo.devices.magicline.com/open-api/device/vending/revalue
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/deviceapi/deviceapi/open-api/device/vending/revalue
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://open-api-demo.devices.magicline.com/open-api/device/vending/revalue \
-H 'Accept-Language: de' \
-H 'Authorization: Bearer <YOUR_oauth2_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"identification": {
"type": "NUMBER",
"value": "1233588160",
"format": "DECIMAL"
},
"transactionId": "4671fde7-bb07-4fe5-aa0e-947d9ccb842f",
"amount": 5.25
}'