Skip to content

Latest commit

 

History

History
51 lines (26 loc) · 1.27 KB

API_README.textile

File metadata and controls

51 lines (26 loc) · 1.27 KB

Scanner API

All requests must include an api_token paramater.

If a request is issued without a api_token, or with an invalid api_token, the response will return:

401 Unauthorized: {"error":"Invalid API token."}}

Check In

Checking in a customer

Resource: POST /api/v1/checkin

Paramaters: api_token, checkin: {card_number, store_id}

CURL example:

curl -v -X POST -H "Content-Type: application/json" --data "{\"api_token\": \"test\", \"checkin\": {\"card_number\": \"123\", \"store_id\": 1}}" http://scanner.144.38.23.210.xip.io/api/v1/checkin

Successful response:

Status code 200 OK

Failure respone:

Status code 406 Not Acceptable


Customers

Creating or updating a customer

Creates a new customer, or updates an existing one if a customer with the supplied card_number already exists.

Resource: POST /api/v1/customers

Paramaters: api_token, customer: {name, card_number, device_token}

CURL example:

curl -v -X POST -H "Content-Type: application/json" --data "{\"api_token\": \"test\", \"customer\": {\"name\": \"John\", \"card_number\": \"123\", \"device_token\": \"ABC123\"}}" http://scanner.144.38.23.210.xip.io/api/v1/customers

Successful response:

Status code 200 OK

Failure respone:

Status code 406 Not Acceptable