Category:API V2: Difference between revisions

Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:API]]
[[Category:API]]
<div class="heading">API Version 2</div>
  This page explains the capabilities of API V2 and explains how to use it.  
  This page explains the capabilities of API V2 and explains how to use it.  


Line 11: Line 8:




API V1 is depreciated, we do not recommend using it for new projects. Information about API V1 can be found here https://wiki.beds24.com/index.php/Category:API
API V1 is deprecated, we do not recommend using it for new projects. Information about API V1 can be found here https://wiki.beds24.com/index.php/Category:API


= Authentication =
= Authentication =
Line 269: Line 266:
Create or update bookings.
Create or update bookings.


 
==== How to Add/remove bookings from a group booking ====
How to Add/remove bookings from a group booking


You can add or remove a booking from a group booking by using the parameter "masterId" without having to use the action "makeGroup"
You can add or remove a booking from a group booking by using the parameter "masterId" without having to use the action "makeGroup"
Line 276: Line 272:
To add a booking to a group booking, you set the master id of the group booking in the "masterId" parameter so it would look like this in your request: "masterId": 1234567, that will modify the booking to add it to the group.
To add a booking to a group booking, you set the master id of the group booking in the "masterId" parameter so it would look like this in your request: "masterId": 1234567, that will modify the booking to add it to the group.


To remove a booking from a group booking, you set the "masterId" parameter to null so it will look like this in your request: "masterId": null,
To remove a booking from a group booking, you set the "masterId" parameter to null so it will look like this in your request: "masterId": null.
 
 
 
==== Using the stripeToken Field to Enable Stripe Payment Actions ====
 
For direct bookings where payment is processed via Stripe, the stripeToken field must be set. This token is typically generated when collecting card details securely through Stripe, ensuring that sensitive information is not handled or stored by Beds24.
 
If the stripeToken is present in a booking, a Stripe button will appear in the Charges and Payments tab. Clicking this button allows you to view Stripe transactions and access all saved cards associated with the booking.
 
For bookings paid through other methods, this field remains empty unless card details are later collected via Stripe.


=== DELETE /bookings ===
=== DELETE /bookings ===
Line 353: Line 359:
Create or modify properties.
Create or modify properties.


== Price rules ==
Note: To update room-level settings, you must include the property id in your request. If it is missing, the system may return an error or incorrectly report success without applying any changes.
 
 
==== Price rules ====


It's currently not possible to create new price rules, however, you can modify the price rules with this request.
It's currently not possible to create new price rules, however, you can modify the price rules with this request.


 
'''''Example: Modify the name of the price rule:'''''
[
     {
     {
       "id": propertyid,
       "id": propertyid,
Line 367: Line 375:
             {
             {
               "priceruleid": 1,
               "priceruleid": 1,
               "name": "Reeeeeeel"
               "name": "-INSERT NAME HERE-"
             }
             }
           ]
           ]
Line 373: Line 381:
       ]
       ]
     }
     }
]


=== DELETE /properties ===
=== DELETE /properties ===
Line 530: Line 537:
=FAQ=
=FAQ=
==How do I access API V2?==
==How do I access API V2?==
Create an invite code under {{#fas:cog}} (SETTINGS) Apps & Integrations > API.
Create an invite code under {{#fas:cog}} (SETTINGS) MARKETPLACE > API.


Exchange this invite code for a refresh token and token using the POST /authentication/setup endpoint.
Exchange this invite code for a refresh token and token using the POST /authentication/setup endpoint.
Line 561: Line 568:


==What is the API credit limit?==
==What is the API credit limit?==
The API credit limit restricts how much you can use the API in a 5 minute window.
The API credit limit restricts how much you can use the API in a 5 minute window, it's by default 100 credits per 5 minutes.


Each API request has a cost, this cost is calculated dynamically and depends on how complex the request is.
Each API request has a cost, this cost is calculated dynamically and depends on how complex the request is.


If you go over this limit you will not be able to make additional API calls until the 5 minute period is over.
If you go over this limit you will not be able to make additional API calls until the 5 minute period is over.
You can increase this limit by contacting the support team through our ticketing system and it will cost 10€ per month to get the limit increased to 200 credits per 5 minutes, this limit can be changed/increased as much as you need.


==Where can I see my API credit limit?==
==Where can I see my API credit limit?==
Line 625: Line 634:


In addition, there is a limit of 10000 top level JSON array item per POST request.
In addition, there is a limit of 10000 top level JSON array item per POST request.
==Channel management only through the API==
Please contact the Beds24 support team and open a ticket with your questions about using only the channel management through the API.


==Where can I see the possible values for a booking's apiSourceId (API Source ID)==
==Where can I see the possible values for a booking's apiSourceId (API Source ID)==