Home Features Pricing Contact Login

REST API

Get vat groups

POST
https://camping.care/api/v1/invoicing/vat_groups

Authentication: API Key

Get vat groups of your park

Parameters

none

Response

201
application/json; charset=utf-8
id
Integer
id of the vat group
name
String
name of the vat group
procent
Double
Percentage of the vat group

Example


/*
* Example get vat groups - How to get vat group information from the Camping.care API
* https://camping.care/developer/invoicing/get_vat_groups
*/
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');

	/*
    * Parameters:
    * None
    *
    */

	/*
	* All data is returned in a vat groups opject
	* The structure can be found here: https://camping.care/developer/invoicing/get_vat_groups.
	*/
    $vat_groups = $campingcare->get_vat_groups();

    /*
     * In this example we print the data in json format on the page
    */
    echo "Vat group data";
    echo "
";
    echo json_encode($vat_groups, JSON_PRETTY_PRINT);
    echo "
"; } catch (Exception $e) { echo "API call failed: " . htmlspecialchars($e->getMessage()); }
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 invoicing_vat_goups
    {

       /*
       * Example vat park - How to get park information from the Camping.care API
       * https://camping.care/developer/park/get_park
       */

        public static async void get_vat_groups()
        {
            try
            {
                Console.WriteLine("*************************************");
                Console.WriteLine("***         GET VAT GROUPS        ***");
                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");

                /*
                * Parameters:
                * None
                *
                */

                var send_data = new List>();

                /*
                * All data is returned in a vat groups opject
                * The structure can be found here: https://camping.care/developer/park/get_vat_groups.
                */

                var data = await camping_care.get_vat_groups(send_data);

                /*
                * In this example we print the oprions in json format in the console
                */

                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);
        }


    }
}
sing 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 accommodation
    {

        /*
        * Example get accommodation - How to get accommodation information from the Camping.care API
        * https://camping.care/developer/accommodations/get_accommodation
        */

        public static async void get_accommodation()
        {
            try
            {
                Console.WriteLine("*************************************");
                Console.WriteLine("***      GET ACCOMMODATION        ***");
                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 = 123;

                /*
                * Parameters:
                * None
                *
                */

                var send_data = new List>();

                /*
                * All data is returned in a accommodation opject
                * The structure can be found here: https://camping.care/developer/accommodations/get_accommodation.
                */

                var data = await camping_care.get_accommodation(id, send_data);

                /*
                * In this example we print the oprions in json format in the console
                */

                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": "90",
        "name": "High",
        "procent": "21",
    },
    "1": {
        "id": "89",
        "name": "Low",
        "procent": "6",
    },
    "2": {
        "id": "88",
        "name": "Zero",
        "procent": "0",
    }
}

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

100
No valid API key
101
No vat group found
102
No admin ID found
0%
()

Cancel upload