REST API Documentation - SCCapstone/EZBag GitHub Wiki

Cart route: POST

  • Url: /cart
  • Input
{
"Barcodes": ["11111111", "1111111111111"], 
"barcodeType": ["ean8", "ean13"], 
"quantities": [1, 2], 
"session": "abc", 
"businessID": "1"
}        
  • Output
{
"Total":"9.99",
"subtotal":"8.90", 
"tax": "1.09"
}
  • Takes barcodes and quantities as input and returns total and subtotal

Customer Info Route: POST

  • Url: /info
  • Input
{
"email":"[email protected]",
"phone":"5557891234", 
"businessID":"1"
}
  • Output
{
"Message": "success"
}
{
"message":"failure"
}

Event Route: POST

  • Url: /event
  • Input
{
"Session": "15386831681",
"type":"customerScannedItem",
"barcode":"abc", 
"businessID":"1"
}
{
"Session":"15386831681",
"type":"customerAddedItemToCart",
"barcode":"abc", 
"businessID":"1"
} 
{
"Session":"15386831681",
"type":"customerRemovedItemToCart",
"barcode":"abc", 
"businessID":"1"
}
  • Output
{
"Message": "success"
}
{
"Message": "failure"
}

Ping Route: GET

  • Url: /ping
  • Input ""
  • Output "pong"

Product route: POST

  • Url: /product
  • Input
{
"barcode":"abc",
"name":"chip",
"price":"5.99",
"description":"good ole chips",
"businessID":"1"
}
  • Output
{
"Message": "success"
}
{
"Message": "failure"
}

Product query route: POST

  • Url: /lookup
  • Input
{
"barcode": "1111111111111" ,
"barcodeType": "ean13", 
"businessID":"1"
}
  • Output
{
"barcode":"abc",
"name":"chip",
"price":"5.99",
"description":"good ole chips",
"businessID":"1"
}

Product Search: POST

  • Url: /search
  • Input
{
"query": "jeff"
}
  • Output
{
"match": [
        {
"barcode":"abc",
"barcodeType": "ean13"
"name": "jeff’s chip",
"price":"5.99",
"description":"good ole chips",
"businessID":"1"
},
… (<= 20 matching products returned)
]
}

Business Login: POST

  • Url: /login
  • Input:
{
"username": "employee1", 
"password": "mystrongpassword"
}
  • Output:
{
"message": "success",
"token": "ads2ghaFK9TDasADFbjk"
} 
{
"message":"failure"
}

Business Get Cart List for Verification: POST

  • Url: /businessCarts
  • Input:
{
"token": "ads2ghaFK9TDasADFbjk"
}
  • Output
{
""
}

Business Cart Verification: POST

  • Url: /cartVerify
  • Input:
{
"token": "ads2ghaFK9TDasADFbjk"
}
  • Output:
{
"cartNumbers": [35, 34, 33, 32],
"cartTime": [1602699192112, 1602699192111, 1602699192109, 1602699192105]
}