Q:

Designing a webservice

I am trying to design a web-service which is used for vehicle parking ticket generation.
One of the APIs is
1. Input: Amount of money customer has deposited.
2. Output: Return the time till which his parking ticket is valid.
e.g. Consider the parking rate is £1 per hour and if the input is £3 and if the current time is 11.30am then the web-service should return 2.30pm. Hope that makes sense.
I was thinking about using RESTful service but I can not figure out what should be the resource. RESTful service does not sound like a good choice.
Any suggestions?

A:

The resource could be just “parkingtickets”. The business action is to ‘create’ a parking ticket. It should be mapped to HTTP POST since the server is to create a resource (parking ticket).  
POST /parkingtickets/
Body:   {amount: <amount>, starttime: <date-time>}
Return: OK, and {ticketid: <id>, endtime: <data-time>}

You can read more on the usage of HTTP verbs in here

