API documentation

Finalize Parking Session with Payment V1

Our platform is integrated with Netopia MobilPay and for the moment we use their sandbox platform. For further details please contact us.
Only for testing you can use the following cards that are accepted by the sandbox platform:

9900004810225098 - accepted card with CVV=111
9900541631437790 - expired card

Also the EPX payment provider is integrated in testing mode for now.
Only for testing you can use the following card that is accepted by EPX's testing platform:

4000000000000002 - accepted card with CVV='', EXP_DATE=12/2025

PUT|PATCH /api/car_driver/parking_sessions/:id/finalize

Include access_token in HTTP header:

Authorization: Bearer 09ba487fc3df...

Description

This web service is used to finalize/finish a parking_session in our database and receive a link that should be used to create the actual payment on the remote payment service.
It also returns access information from the updated parking session.

REQUEST PARAMETERS

Parameter name Parameter type Description
id int it's the parking session id in DB and it's part of the request URL
parking_session object object containing the parking_session form data
secured_parking_id int id of the parking used to create the parking_session
{
  "parking_session" : {
    "secured_parking_id" : 187
  }
}

Response

Status Code: 201 if OK

{
  "pay_url": "http://www.example.com/api/payment/pay/1?from_mobile_v4=true",
  "amount": "10.00",
  "currency": "RON",
  "parking_session": {
    "id": 1,
    "type": "pay_per_use",
    "state": "exiting",
    "start_time": "2017-09-07T08:00:00+00:00",
    "end_time":"2017-09-07T09:05:00+00:00",
    "entrance_remaining_tries":10,
    "exit_remaining_tries":10
  },
  "smart_key": {
    "id":1,
    "secured_parking_id":1,
    "name":"Secured P 1",
    "description":null,
    "is_active":null,
    "type":"session_access",
    "access_command":"205e32dc97f079cce7b312b4b7ad3a83ec451cb652c1a0cbf49627eb3112c6041f03",
    "is_online":false,
    "start_time":"2017-09-07T09:05:00+00:00",
    "end_time":"2017-09-07T09:10:00+00:00",
    "access_points": [
      {
        "access_point": {
          "module_id":2,
          "mac_address": "76:86:BB:DE:63:AD"
        }
      },
      {
        "access_point": {
          "module_id":1,
          "mac_address":"6F:FF:D3:B0:57:39"
        }
      }
    ]
  }
}

Response parameters

Parameter name Parameter type Description
pay_url string url to be used to make a GET request in mobile WebView in order to continue with the payment
amount string amount (decimal representation, 2 decimals precision) that is going to be payed
currency string currency configured on the parking
parking_session object object containing information about the just created parking session
parking_session/id int db id of the parking session
parking_session/type string the type of parking session, the only possible value for now is "pay_per_use"
parking_session/state string session state, can be entering, active, exiting ...
parking_session/start_time string session start_time (iso8601 format)
parking_session/end_time string session end_time will be updated at finalize (iso8601 format)
parking_session/entrance_remaining_tries int countdown of remaining available tries with smart_key to enter the parking
parking_session/exit_remaining_tries int countdown of remaining available tries with smart_key to exit the parking
smart_key object object containing information about the entrance smart_key the same structure from GET /api/car_driver/smart_keys
smart_key/id int id of the smart_keys
smart_key/secured_parking_id int ...
smart_key/name string the name of the secured_parking
smart_key/description string description of the smart_key
smart_key/is_active boolean true if the parking is active
smart_key/type string type of the smart_key, only the 'session_access' value in this WS
smart_key/access_command string command to be sent in order to open the barrier
smart_key/is_online boolean true if the parking is "exclusively online", in which case the given access_command is unusable
smart_key/start_time string key start time
smart_key/end_time string key end time
smart_key/access_points array array of access_points associated to the smart_key
smart_key/access_points/access_point object access_point information ...

Status Code: 400 if secured_parking_id or parking_session params are missing

Status Code: 401 if request access token not ok

Status Code: 404 if resources for secured_parking_id, or id params are not found

Status Code: 422 if there were errors (messages included in body)