Home Features Pricing Contact Login

REST API

Get tax

POST
https://camping.care/api/v1/accommodations/id/tax

Authentication: API Key

Parameters

Replace id in the endpoint URL by the accommodation id, for example: "https://camping.care/api/v1/accommodations/2/tax".

The specific id from a accommodation can be get by the function Get accommodations.
language
STRING
Request the accommodation data in a different language (ISO Language Code)

Response

201
application/json; charset=utf-8
tax array
Integer
The array of tax

Example


/*
 * Example get tax - How to get acoomodation tax the Camping.care API
 * https://camping.care/developer/accommodations/get_tax.
 */
try {

    /*
    * Initialize the Camping.care API SDK with your API key.
    *
    * See: https://camping.care/settings/api
    */

    require_once dirname(__FILE__) . '/../../src/campingcare/Autoloader.php';

    $campingcare = new campingcare_api ;
    $campingcare->set_api_key('YOUR API KEY');

    /*
    * Set your accommodation id. It can be found by using the function get_accommodations 
    * http://camping.care/developer/accommodations/get_accommodations
    */

    $id =  37 ; // Accommodation ID (required)

    /*
    * Parameters:
    * language : ISO language code (optional)
    *
    */

    $data = array();
    $data['language'] = "de" ;


    /*
     * All data is returned in a option opject
     * The structure can be found here: https://camping.care/developer/accommodations/get_tax.
     */
    $tax = $campingcare->get_tax($id, $data);


    /*
    * In this example we print the data in json format on the page
    */
    echo "GET accommodation tax";
    echo "
";
    echo json_encode($tax, JSON_PRETTY_PRINT);
    echo "
"; } catch (Exception $e) { echo "API call failed: " . htmlspecialchars($e->getMessage()); }
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using campingcare;
using Newtonsoft.Json.Linq;


namespace campingcare_csharp_sdk_tests
{
    public static class tax
    {

        /*
        * Example get options - How to get acoomodation options the Camping.care API
        * https://camping.care/developer/accommodations/get_tax.
        */

        public static async void get_tax()
        {
            try
            {
                Console.WriteLine("*************************************");
                Console.WriteLine("***             GET TAX           ***");
                Console.WriteLine("*************************************");

                /*
                * Initialize the Camping.care API SDK with your API key.
                *
                * See: https://camping.care/settings/api
                */

                campingcare_api camping_care = new campingcare_api();
                camping_care.set_api_key("YOUR API KEY");

                /*
                * Set your accommodation id. It can be found by using the function get_accommodations 
                * http://camping.care/developer/accommodations/get_accommodations
                */

                int id = 37;

                /*
                * Parameters:
                none
                *
                */
                var send_data = new List>();

                /*
                * All data is returned in a option opject
                * The structure can be found here: https://camping.care/developer/accommodations/get_tax.
                */
                var data = await camping_care.get_tax(id, send_data);

                /*
                * In this example we print the oprions in json format on the page
                */
                JObject json = JObject.Parse(data.ToString());

                foreach (var pair in json)
                {
                    Console.WriteLine("{0}: {1}", pair.Key, pair.Value);
                }

            }
            catch (Exception ex)
            {
                LogData(ex.Message);
            }
        }

        private static void LogData(string Message)
        {
            Console.WriteLine("Error: " + Message);
        }
    }
}


Response example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "0": {
        "id": "246",
        "name": "Taxes",
        "person_no_min": "1",
        "person_no_max": "6",
        "type": "price",
        "type_pro": "night",
        "type_amount": "2",
        "age_table_id": "0",
        "accommodation_id": "74",
        "translation_name": 1
    },
    "n": {
        ...
    }
}

Response Error

Returns an array with error information

230
application/json; charset=utf-8
code
Integer
The error code listed in a list below
message
String
The error message listed in a list below

Error Codes

1000
No valid API key
1033
No tax found
1034
No admin ID found
1035
Accommodation not found
1036
No rights for this accommodation
0%
()

Cancel upload