Home Features Pricing Contact Login

REST API

Get invoices

GET
https://camping.care/api/v1/invoicing

Autorication: API Key

Get invoices created between dates.

Parameters

start_date
Date
The start date of the invoices creation date in the format yyyy-mm-dd
end_date
Date
The end date of the invoices creation date in the format yyyy-mm-dd

Response

201
application/json; charset=utf-8
ARRAY of folowing parameters
id
Integer
The id of the invoice
invoice_id
Integer
The invoice id of the administration
contact_id
Integer
The id of the contact for this invoice
order_id
Integer
The order id of the invoice
status
String
The status of the payment of the invoice in a string: with status draft, paid, unpaid, partly_paid, removed, concept
type
String
The type of the invoice in a string of type 'invoice', 'offer'
subtotal
Double
Subtotal amount of the invoice
vat
Double
vat of the invoice
total
Double
Total amount of the invoice
currency
String
Currency of the reservation in currencies: EUR, USD, GBP, CHF
create_date
Date
The creation date of the invoice
expire_date
Date
The expire date of the invoice
contact_name
String
The contact name for the invoice

Example


/*
* Example get invoices - How to get invoices between a start and end date from the Camping.care API
* https://camping.care/developer/invoicing/get_invoices
*/

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:
    * start_date:		The arrival date where reservations have to be inbetween (required)
    * end_date:			The departure date where reservations have to be inbetween (required)
    *
    */

	$data = array();
	$data["start_date"] = "2017-01-01"; // start invoice create date: YYYY-MM-DD (required)
	$data["end_date"] = "2018-12-31"; // end invoice create date: YYYY-MM-DD (required)

	/*
	* All data is returned in a invoice object
	* The structure can be found here: https://camping.care/developer/invoicing/get_invoice.
	*/

	$invoices= $campingcare->get_invoices($data);

	/*
	* In this example we print the data in json format on the page
	*/

    echo "Invoices";
    echo "
";
    echo json_encode($invoices, 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 invoices
    {
        
        /*
        * Example get invoices - How to get invoices between a start and end date from the Camping.care API
        * https://camping.care/developer/invoicing/get_invoices
        */

        public static async void get_invoices()
        {
            try
            {
                Console.WriteLine("*************************************");
                Console.WriteLine("***           GET INVOICES        ***");
                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:
                *   start_date:		    The arrival date where reservations have to be inbetween (required)
                *   end_date:			The departure date where reservations have to be inbetween (required)
                *
                */

                var send_data = new List>();
                send_data.Add(new KeyValuePair("start_date", "2017-01-01"));
                send_data.Add(new KeyValuePair("end_date", "2018-12-31"));

                /*
                * All data is returned in a invoice object
                * The structure can be found here: https://camping.care/developer/invoicing/get_invoice.
                */

                var data = await camping_care.get_invoices(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": "1",
        "invoice_id": "20170001",
        "contact_id": "1",
        "order_id": "1",
        "status": "unpaid",
        "type": "invoice",
        "subtotal": "8.26",
        "vat": "1.74",
        "total": "10",
        "currency": "EUR",
        "create_date": "2017-12-20",
        "expire_date": null,
        "contact_name": "Doe John"
    },
    "1": {
        "id": "2",
        "invoice_id": "20170002",
        "contact_id": "2",
        "order_id": "2",
        "status": "unpaid",
        "type": "invoice",
        "subtotal": "37.2",
        "vat": "7.8",
        "total": "45",
        "currency": "EUR",
        "create_date": "2017-12-22",
        "expire_date": null,
        "contact_name": "John Doe"
    },
    "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

4000
No valid API key
4001
No invoices found
4002
No admin ID found
4003
Not a valid start date
4004
Not a valid end date
4005
End date is before start date
0%
()

Cancel upload