Using the Transactional API
This walkthrough provides tutorials on the standard API calls used within our service.
Overview#
Arrive provides a transactional API that makes it easy for any partner to programmatically find and book parking. Below we'll walk through some key concepts and common API flows to help you get started. For more detailed information, be sure to read our full API reference.
Introduction#
Base URLs#
Sandbox:
- API:
https://api-sandbox.parkwhiz.com/
- Website:
https://sandbox.parkwhiz.com
Production:
- API:
https://api.parkwhiz.com/
- Website:
https://www.parkwhiz.com
Note that the websites can be co-branded for brand loyalty as well.
Authentication#
All transactional API endpoints require authentication; thus you'll need an access token for every request. Tokens can be created using a token grant flow. Here's an example of creating an access token with the client_credentials
grant type in our sandbox environment:
This will return the following response:
This token can be used with the endpoints defined in our API docs, including the example requests below.
Examples#
Perform search and book on invoice#
Search using coordinates
The following request will return a list of locations that utilize mobile parking passes within a half mile of the specified latitude and longitude:
This will return a set of results similar to below:
With these results, you can choose to send someone to checkout on web using the site:purchase
attribute, or book on invoice. For this example, we'll walk through the latter.
Book on invoice
Booking on invoice is as it sounds -- once a request is made to perform a booking, a parking pass is issued and payment will be reconciled between Arrive and the distribution partner at a later date. Note that we limit this capability to partners that process their own payments, and where we have a strategic relationship with.
Here's an example of an API call to book on invoice using the result above:
This will return a booking
object:
You can also configure the API to return a parking pass URL and authorization code, which enables anonymous access to the pass itself. See the booking API docs for more details.
Fetch events with parking availability#
This example enables a partner to make an API request to return parking availability and purchase options near a venue. Each option includes a URL for an user to complete their purchase on parkwhiz.com.
Find venue
First, let's find events for a venue using its Arrive ID. You can search for venue by name using the venues
endpoint, and the q
parameter:
A partial response:
Retrieve events and parking availability
Now, we can retrieve events for that specific venue using the events
endpoint. You can use the fields
parameter to customize the fields returned in the response:
Partial response:
Using the availability
element above, we can see that there are five parking options available priced between $20-25 for the event.
Handoff to web for checkout
Now, we can use the site_url
element in the response above to grab the URL the user can use to checkout:
https://www.parkwhiz.com/united-center-parking/carrie-underwood-758500/
Finally, an affiliate code can be added to the URL to properly track bookings and co-brand the landing page.