Child pages
  • Vending web service
Skip to end of metadata
Go to start of metadata


PRE-AUTH SALE FLOW

 

AUTH request

Request
POST <host url>/vending/auth.json?vendingmachineid=231ASDFD21321&cardnumber=213231221&maxamount=10000&apikey=338936767883
 
or
 
POST <host url>/vending/auth.json
 

 

auth.json (body)Paramter nameFormatMandatoryDescription

{

"apikey": "338936767883",

"vendingmachineid": "231ASDFD21321" ,

"cardnumber": "2132311221",

"maxamount": 10000,

"externaltransactionid": "ABC123"

}

apikeylongyesBRP API access key
vendingmachineidstringyesUnique id of the vending machine. Must be configured in BRP
cardnumberstringyesCard number. Can be hex decimal or decimal depending on configuration in BRP
maxamountlongyesReserved amount that can be used for purchasing in cents, i.e. price*1000 as integer

externaltransactionid

stringnoExternal transaction id, will be saved on the transaction for reference

AUTH response

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
200 HTTP_OK

{

"transactionid": 342342423,

"reservedamount": 5000,

"errorcode": 0

}

transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
errorcodeintyes0 = Pre-auth purchase transaction request is accepted

AUTH response error codes  

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
 400 HTTP_BAD_REQUEST

{

"errorcode": 1

 errorcode int yes 1 = Invalid parameters in request
 404 HTTP_NOT_FOUND 

{

"errorcode": 2

 errorcode int yes  2 =   Vending machine not found  
 404 HTTP_NOT_FOUND 

{

"errorcode": 3

 errorcode int yes 3 =   Card number not found
 406 HTTP_NOT_ACCEPTABLE 

{

"errorcode": 5

 errorcode int yes  5 =  No credit found
 500 INTERNAL_SERVER_ERROR 

{

"errorcode": 6

 errorcode int yes 6 =  Internal error in BRP
406 HTTP_NOT_ACCEPTABLE

{

"errorcode": 7

}

errorcodeintyes7 = External transaction id already used

CAPTURE request

Request
POST <host url>/vending/capture.json?transactionid=342342423&slotid=A33&amount=5000&apikey=338936767883
 
or
 
POST <host url>/vending/capture.json
capture.json (body)Paramter nameFormatMandatoryDescription

{

"apikey": "338936767883",

"transactionid": "231ASDFD21321",

"slotid": "A33",

"amount": 10000

}

apikeylongyesBRP API access key
transactionidstringyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
slotidstringyesSlot id in the vending machine. Must be also be configured in the BRP system.
amountlongyesProduct amount in cents, i.e. price*100 as Integer.

CAPTURE response

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
200 HTTP_OK

{

"transactionid": 342342423,

"errorcode": 0

}

transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
errorcodeintyes0 = Complete Pre-auth purchase transaction request is accepted

CAPTURE response error codes

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
400 HTTP_BAD_REQUEST

{

"errorcode": 1

errorcodeintyes 1 = Invalid parameters in request
 406 HTTP_NOT_ACCEPTABLE

{

"errorcode": 4

 errorcode int yes 4 = Invalid amount
 404 HTTP_NOT_FOUND 

{

"errorcode": 8

 errorcode int yes  8 =  Transaction id not found  
 500 INTERNAL_SERVER_ERROR 

{

"errorcode": 6

 errorcode int yes 6 =  Internal error in BRP

ANNUL request

Request
POST <host url>/vending/annul.json?transactionid=342342423&apikey=338936767883
 
or
 
POST <host url>/vending/annul.json

 

annul.json (body)

Paramter nameFormatMandatoryDescription

{

"apikey": "338936767883",

"transactionid": 342342423

}

apikeylongyesBRP API access key
transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow

ANNUL response

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
200 HTTP_OK

{

"transactionid": 342342423,

"errorcode": 0

}

transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
errorcodeintyes0 = Complete Pre-auth purchase transaction request is accepted

ANNUL response error codes

HTTP Status codeResponse (body)Description
404 HTTP_NOT_FOUND

{

errorcode = 8

}

8 =  Transaction id not found



PRE-SELECT SALE FLOW

 

SALE request

Request
POST <host url>/vending/sale.json?vendingmachineid=231ASDFD21321&cardnumber=213231221&slotid=A33&amount=4500&apikey=338936767883
 
or
 
POST <host url>/vending/sale.json
 

 

sale.json (body)Paramter nameFormatMandatoryDescription

{

"apikey": "338936767883",

"cardnumber": "213231221",

"vendingmachineid": "231ASDFD21321",

"slotid": "A33",

"amount": 10000,

"externaltransactionid": "ABC123"

}

apikeylongyesBRP API access key
cardnumberstringyesCard number. Can be hex decimal or decimal depending on configuration in BRP
vendingmachineidstringyesUnique id of the vending machine. Must be configured in BRP
slotidstringyesSlot id in the vending machine. Must be also be configured in the BRP system.
amountlongyesProduct amount in cents, i.e. price*100 as Integer.
externaltransactionidstringnoExternal transaction id. Will be stored on the transaction for reference.

SALE response

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
200 HTTP_OK

{

"transactionid": 342342423,

"errorcode": 0

}

transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
errorcodeintyes0 = Complete Pre-auth purchase transaction request is accepted

SALE response error codes

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
400 HTTP_BAD_REQUEST

{

"errorcode": 1

errorcodeintyes 1 = Invalid parameters in request
 406 HTTP_NOT_ACCEPTABLE

{

"errorcode": 4

 errorcode int yes 4 = Invalid amount
 404 HTTP_NOT_FOUND 

{

"errorcode": 2

 errorcode int yes 2   =   Vending machine not found  
 500 INTERNAL_SERVER_ERROR 

{

"errorcode": 5

 errorcode int yes 5 =  Internal error in BRP
404 HTTP_NOT_FOUND

{

"errorcode": 3

errorcodeintyes3 = Card number not found
406 HTTP_NOT_ACCEPTABLE

{

"errorcode": 7

}

errorcodeintyes7 = External transaction id already used

ANNUL request

Request
POST <host url>/vending/annul.json?transactionid=342342423&apikey=338936767883
 
or
 
POST <host url>/vending/annul.json

 

annul.json (body)

Paramter nameFormatMandatoryDescription

{

"apikey": "338936767883",

"transactionid": 342342423

}

apikeylongyesBRP API access key
transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow

 

ANNUL response

HTTP Status codeJSON Response (body)Paramter nameFormatMandatoryDescription
200 HTTP_OK

{

"transactionid": 342342423,

"errorcode": 0

}

transactionidlongyesUnique identifier of this transaction, e.g will be used during rest of purchasing flow
errorcodeintyes0 = Complete Pre-auth purchase transaction request is accepted

ANNUL response error codes

HTTP Status codeResponse (body)Description
404 HTTP_NOT_FOUND

{

errorcode = 8

}

8 =  Transaction id not found

 

LIST TRANSACTION

Request
GET <host url>/vending/list.json?transactionid=342342423&apikey=338936767883
 

 

list.json

Paramter nameFormatMandatoryDescription

 

apikeylongyesBRP API access key
transactionidlongnoIf supplied, answer will be the transaction with the specified transaction id
externaltransactionidstringnoIf supplied, answer will be the transaction with the specified external transaction id
vendingmachineidstringno

If supplied, answer will be all transactions on the specified machine for the last 7 days

(must be supplied if neither transactionid or externaltransactionid is supplied)

transactionsfromdatenoIso-formatted date to list transactions older than 7 days.

 

 

 


  • No labels