> For the complete documentation index, see [llms.txt](https://docs.phptravels.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phptravels.com/support/for-developers/api-version-9.md).

# API Version 9

PHPTRAVELS API version 9 docs: the REST API for connecting desktop, tablet and mobile apps, with request and response examples in the Postman collection.

If you are looking to communicate with the database through PHPTRAVELS Restful API then you are on the right page. \
\
We have created a simple Restful API which can be easily integrated with any platform such as \
\
\- Desktop App \
\- Tablet Apps \
\- Mobile Applications \
\
To communicate with our APIs, read the request and response methods from postman documentation. \
\
Here is the link <https://documenter.getpostman.com/view/14040395/2s93CLstMZ> \
\
Further should you require any help feel free to contact us over <info@phptravels.com>&#x20;

### Who this is for

This page is for developers who connect another application to a PHPTRAVELS website running **version 9**: a desktop app, a tablet or mobile app, or another platform that needs to read and write booking data. The API is a REST API, so any language that can send HTTP requests and read JSON can use it. If your site runs **version 10**, read the [For Developers](https://docs.phptravels.com/support/for-developers) section first; the v10 routing and module structure is described there.

### How to use the documentation

1. Open the [Postman documentation](https://documenter.getpostman.com/view/14040395/2s93CLstMZ) linked above.
2. Browse the folders to find the endpoints you need. Each request shows the method, URL, parameters and an example response.
3. Use **Run in Postman** (or copy the requests) to load them into your own Postman workspace.
4. Set the variables the collection uses, such as the base URL of your own PHPTRAVELS website, before you send requests.
5. Send each request against a test or staging copy of your site first, not your live site.

### Good practice

* Call the API over HTTPS only.
* Keep any keys or tokens out of mobile app source code and public repositories.
* Read the example response for each endpoint and handle error responses in your app, not only the success case.
* Log requests and responses during development so you can share them with support.
* Test bookings and payments end to end before releasing your app.

### Common problems

* **404 Not Found** -- the base URL is wrong, or the server's rewrite rules (`.htaccess`) are missing, so requests do not reach PHPTRAVELS.
* **Empty or unexpected data** -- the request parameters do not match the documented ones; compare with the Postman example.
* **Works in Postman but not in the browser** -- cross-origin (CORS) rules on your server block browser requests; call the API from your backend or adjust the server settings.
* **Mixed content errors** -- your app calls `http://` while the site uses HTTPS.

Need help? Email <info@phptravels.com> or [submit a ticket](https://docs.phptravels.com/support/submit-ticket) with the request and response you are testing.
