Back to overview
Products API
This API endpoint let you manage your products.
Index:
- List all products
- Retrieve a single product
- Create a product
- Update a product
- Remove a product
- Available form parameters
List all product
Get a list of all your product returned in JSON
format.
GET https://app.mytourist.cloud/api/v1/products
Example result
[
{
"id":"23192011031",
"category":{
"id":"23192010291",
"name":"Rental",
"color":"#55BB5A"
}
"tax_id":"23192011034",
"language":"en",
"price":14.00,
"name":"Bike Rental",
"description":"Electric bike.",
"translations":{
"name":{
"de":"Fahrad verleih",
"...":"..."
},
"description":{
"de":"Elektrisches Fahrrad",
"...":"..."
}
},
"calculation_methods":[
"person",
"night"
],
"auto_add_when_booked_on_roomtypes":[]
},
{
"id":"23192011032",
"category":{
"id":"23192010292",
"name":"General",
"color":"#55BB5A"
},
"tax_id":"23192011034",
"language":"en",
"price":60.00,
"name":"Final cleaning",
"description":"Each booker has to pay this amount as final cleaning service.",
"translations":{
"name":{
"de":"Endreinigung",
"...":"..."
},
"description":{
"de":"Jeder Bucher muss diesen Betrag als Endreinigungsservice bezahlen.",
"...":"..."
}
},
"calculation_methods":[],
"auto_add_when_booked_on_roomtypes":[
{
"id":"23192010281",
"name":"Tweepersoonskamer met balkon"
},
{
"id":"23192010282",
"name":"6 Pers. appartement"
}
]
}
]
Retrieve a single product
Same type of results as the list function above, only this endpoint will return only the Product you just requested.
GET https://app.mytourist.cloud/api/v1/products/{PRODUCT_ID}
Create a product
For products we always advise to fill the content variables with the language of your Invoices. So that the products displayed on your Invoices not printing the automatically translated information. For a list of Available form parameters see bottom of this page.
Automatically translations for the name
and description
fields will be generated after 30 minutes of your last change
POST https://app.mytourist.cloud/api/v1/products
Update a product
The update function is exactly the same as above. The only difference is that no fields are required. Only the fields you push to us will be changed (even empty ones). All other fields will be ignored. For a list of Available form parameters see bottom of this page.
Automatically translations for the name
and description
fields will be generated after 30 minutes of your last change
POST https://app.mytourist.cloud/api/v1/products/{DEBTOR_ID}
Remove a product
This has no effect on your proforma invoices. When you want to delete those products also from your proforma invoices you’ll need to remove those product lines. See Invoices API documentation for more information about invoice product lines.
DELETE https://app.mytourist.cloud/api/v1/products
Available form parameters
The calculation_methods
provide you with the possibility to automatically calculate the price per night or/and nights .. when the product is added to your invoice it will calculate the price based on those two items. But is always optional.
The auto_add_when_booked_on_roomtypes
becomes handy when you want to add this product automatically to the booking Invoice. Mostly used with final cleaning purposes.
language | required* | iso | nl, de, fr or en |
name | required* | string | In the language you set |
description | required* | string | In the language you set |
price | required* | float | Per piece |
category_id | required* | integer | @category_id ProductCategories API |
calculation_methods | optional | string | Pick: person or/and night (devided by comma) |
tax_id | optional | integer | @tax_id TaxRates API |
auto_add_when_booked_on_roomtypes | optional | string | @roomtype_id's devided by a comma Roomtypes API |
* required when creating a product.