test

We gebruiken cookies om content en advertenties te personaliseren en om ons websiteverkeer te analyseren. Ook delen we informatie over het gebruik van onze site met onze partners voor advertenties en analyses. Deze partners kunnen deze gegevens combineren met andere informatie die je aan ze hebt verstrekt of die ze hebben verzameld op basis van je gebruik van hun services.

REST API v1 / JSON / Webhooks

MyTourist API for developers Your code. Our booking data.

A REST API and webhooks to connect your own software to the MyTourist PMS and channel manager. Open docs, JSON throughout and one token per company profile.

OpenAPI 3.0 Postman curl, PHP, JavaScript
~/my-booking-site bash
$ curl -G https://app.mytourist.cloud/api/v1/availability \
  -H "Authorization: Bearer $MYTOURIST_TOKEN" \
  -d arrival=2030-07-01 \
  -d departure=2030-07-04
200 OK application/json
[
  {
    "id": "81912063",
    "name": "Doubleroom Deluxe with balcony",
    "rooms_available": 1,
    "rates": [
      {
        "id": 66118004,
        "name": "Conform arrangement",
        "rate_available": true,
        "total_price": 200
      },
      {
        "id": 82010274,
        "name": "Bubbles arrangement",
        "rate_available": false,
        "reasons": ["closedonarrival", "minstay"]
      }
    ]
  }
]
56
endpoints in 12 resources
8
webhook triggers
3×
retry after 5, 15 and 60 minutes
24
months of logs for every call
The API

What you can do with the MyTourist API

Read, create, update and cancel. Updates are partial: you only send what changes. Pick a resource to see its endpoints.

/api/v1/availability

Availability

Free room types with the calculated total per rate, and the reason when a rate is not bookable, such as minstay or closedonarrival.

/api/v1/calendar

Calendar

Fetch prices, availability and restrictions per day, and change them in bulk.

/api/v1/roomtypes

Room types

Room types with their rooms, like a double room with room 4 and room 6.

/api/v1/price-rates

Price rates

The rates per room type, like a weekend package or a long stay rate.

/api/v1/property

Property

Address and company data of the company profile behind the token.

Code example

Try the API yourself

Three calls you will almost certainly need, in curl, PHP or JavaScript. Copy, add your token, run.

POST /bookings
curl -X POST https://app.mytourist.cloud/api/v1/bookings \
  -H "Authorization: Bearer $MYTOURIST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "arrival": "2030-07-01",
    "departure": "2030-07-04",
    "roomtype_id": "81912063",
    "rate_id": "66118004",
    "number_of_guests": 2,
    "debtor_id": "23192010294",
    "channel": "api",
    "channel_reference": "WEB-10482"
  }'
$client = new GuzzleHttp\Client(['base_uri' => 'https://app.mytourist.cloud/api/v1/']);

$res = $client->post('bookings', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('MYTOURIST_TOKEN')],
    'json' => [
        'arrival' => '2030-07-01',
        'departure' => '2030-07-04',
        'roomtype_id' => '81912063',
        'rate_id' => '66118004',
        'number_of_guests' => 2,
        'channel_reference' => 'WEB-10482',
    ],
]);

$booking = json_decode($res->getBody(), true);
echo $booking['invoice']['total_amount_incl_vat']; // 200
const res = await fetch('https://app.mytourist.cloud/api/v1/bookings', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.MYTOURIST_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    arrival: '2030-07-01',
    departure: '2030-07-04',
    roomtype_id: '81912063',
    rate_id: '66118004',
    number_of_guests: 2,
    channel_reference: 'WEB-10482',
  }),
});

const booking = await res.json(); // booking.id, booking.invoice
Response 200 OK
{
  "id": 231920102956,
  "state": "confirmed",
  "arrival": "2030-07-01",
  "departure": "2030-07-04",
  "roomtype": {
    "id": "81912063",
    "name": "Doubleroom Deluxe with balcony",
    "placed_in_room": "Room 6"
  },
  "number_of_guests": 2,
  "rate": { "id": "66118004", "name": "Conform arrangement" },
  "channel": { "label": "api", "reference": "WEB-10482" },
  "invoice": {
    "id": "P1020077",
    "total_amount_incl_vat": 200,
    "has_amount_to_pay": true
  }
}
GET /invoices/{INVOICE_ID}
curl https://app.mytourist.cloud/api/v1/invoices/P1020077 \
  -H "Authorization: Bearer $MYTOURIST_TOKEN"

# Or as a PDF
curl https://app.mytourist.cloud/api/v1/invoices/P1020077/pdf \
  -H "Authorization: Bearer $MYTOURIST_TOKEN" -o invoice.pdf
$res = $client->get('invoices/P1020077', [
    'headers' => ['Authorization' => 'Bearer ' . getenv('MYTOURIST_TOKEN')],
]);

$invoice = json_decode($res->getBody(), true);

foreach ($invoice['product_lines'] as $line) {
    echo $line['description'] . ': ' . $line['price_incl_vat'] . PHP_EOL;
}
const res = await fetch('https://app.mytourist.cloud/api/v1/invoices/P1020077', {
  headers: { 'Authorization': `Bearer ${process.env.MYTOURIST_TOKEN}` },
});

const invoice = await res.json();
const open = invoice.financial_state === 'open';
Response 200 OK
{
  "id": "P1020077",
  "type": "proforma",
  "financial_state": "open",
  "reservation": "231920102956",
  "reference": "PO-12345",
  "product_lines": [
    {
      "type": "logies",
      "description": "Doubleroom with balcony - 3 night(s) - 2 guest(s)",
      "price_incl_vat": "200.00",
      "tax_rate": "9.00"
    }
  ],
  "tourist_tax": { "amount": "0.00", "based_on_guests": 0 },
  "payments": []
}
POST https://your-app.example/hooks/mytourist
# Simulate a webhook on your own machine
curl -X POST http://localhost:3000/hooks/mytourist \
  -d trigger=booking_checkin \
  -d id=231920102956 \
  -d 'roomtype[placed_in_room]=Room 6'
// Webhooks arrive as form fields, nested data as arrays
$trigger = $_POST['trigger'] ?? null;

if ($trigger === 'booking_checkin') {
    $room = $_POST['roomtype']['placed_in_room'];
    unlockDoor($room); // your own code
}

http_response_code(200); // anything else is retried
// Express: webhooks arrive as form fields
app.use(express.urlencoded({ extended: true }));

app.post('/hooks/mytourist', (req, res) => {
  const { trigger, id } = req.body;

  if (trigger === 'booking_created') {
    notifyTeam(`New booking ${id}`); // your own code
  }

  res.sendStatus(200); // anything else is retried
});
What your endpoint receives 200 OK
{
  "trigger": "booking_checkin",
  "id": 231920102956,
  "state": "confirmed",
  "arrival": "2030-07-01",
  "departure": "2030-07-04",
  "roomtype": { "placed_in_room": "Room 6" },
  "access_code": "4711",
  "checkin_at": "2030-07-01 15:42:10"
}
Webhooks

Webhooks: get bookings and payments in real time

Stop polling. Pick a trigger and an https URL in MyTourist, and on every event we send a POST with the trigger field and the full data. For a booking, that is the same data you get when you fetch a booking.

Reply with 200 and the delivery counts as done. Otherwise we retry after 5, 15 and 60 minutes. Tip: test with webhook.site first.

booking_created A booking has been created
booking_updated A booking has been changed
booking_cancelled A booking has been cancelled
booking_checkin A guest has checked in
booking_checkout A guest has checked out
debtor_created A debtor has been created
debtor_updated A debtor has been changed
payment_received A payment has been received
Use cases

What developers build with it

A few ideas to get started. Under every card you see the route through the API.

Your own booking flow

Check availability and rates, create the booking and fetch the invoice, right inside your own website or app.

GET /availability POST /bookings

A door code per booking

Create a code in your lock system for every new booking and write it back to access_code, so it shows up in the guest email.

booking_created POST /bookings/{id}

Till and bar

Post sales from the bar or shop as product lines on the guest invoice and book the payment.

POST /invoices/{id}/lines POST /invoices/{id}/payments

Dashboard or data warehouse

Pull bookings, invoices and payments per period and report your own way.

GET /bookings GET /invoices/payments

Cleaning schedule

Schedule a clean as soon as a guest checks out, in the planning tool your team already uses.

booking_checkout GET /bookings/current-bookings

CRM or newsletter

Send new guests straight to your CRM or mailing tool and keep their details up to date there.

debtor_created debtor_updated
Get started

Go live in four steps

  1. 01

    Grab your token

    In MyTourist under Connections > API. One token per company profile, and resettable: the old one stops immediately.

  2. 02

    Test in a trial profile

    There is no separate sandbox. Create a trial profile and ask Support to enable the API and webhooks there.

  3. 03

    Import and watch

    Load the Postman collection or openapi.json. Recent API calls shows your traffic, refreshed every 10 seconds.

  4. 04

    Go live, with caching

    At most 10 requests per 10 seconds. Cache what you need often and you stay well under the limit.

Everything you need to start
Public, no account needed to look around.

No account yet? First have a look at the MyTourist pricing.

API FAQ

Question not listed? We are happy to help, in Dutch, English or German.

Get in touch
There are 56 endpoints for bookings, availability, the calendar, debtors, invoices, room types, rates, products and vouchers. The full list is in the public API docs, with an openapi.json download, a Postman collection and examples in curl, PHP and JavaScript.
No, MyTourist does not build custom integrations. Support does help with questions about the API itself: endpoints, authentication and responses. In Dutch, English and German.
There is no separate sandbox. Test in a trial profile: create a new company profile and ask Support to enable the API and webhooks there. That keeps your real administration out of harm's way.
10 requests per 10 seconds. Above that you get HTTP 429. Use the list endpoints with a date range instead of fetching items one by one, and cache what you need often, such as room types and rates.
Anything other than HTTP 200 counts as failed. We retry after 5, 15 and 60 minutes, then we stop. So reply with 200 quickly and process the message afterwards.

Try for 7 days free of charge without obligation

No credit card needed

  • No automatic subscription
  • Cancel monthly
  • Support in EN, NL and DE

Rather see how it works first? Watch the live demo

Patrick van MyTourist