Home Features Pricing Contact Login

REST API

Get invoice

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

Autorication: API Key

Get a specific invoice by id.

Parameters

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

Response

201
application/json; charset=utf-8
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
last_name
String
The last name of the contact
country
String
The country of the contact
paid_amount
String
The amount paid of the invoice
term_count
String
Nr of terms the invoice has to be paid
last_modified
String
last modified date of the invoice
modified_by
String
modified by user id
rows
Array
Array of invoice rows
id
Int
id of invoice row
row_id
Int
id of invoice
product_id
Int
id of product for invoice
product_type
Int
product type of invoice
description
String
description of invoice row
amount
String
amount for current invoice row
vat_procent
Double
Vat amount percentage
price
Double
Price for current row
vat
Double
Calculated Vat for current row
subtotal
Double
Subtotal for the current row

Example


/*
* Example get invoices - How to get a specific invoice from the Camping.care API
* https://camping.care/developer/invoicing/get_invoice
*/

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 invoice id. It can be found by using the function get_invoices
    * https://camping.care/developer/invoicing/get_invoice
    */

	$invoice_id = 321;

	/*
    * Parameters:
    * None
    *
    */



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

    $invoice= $campingcare->get_invoice($invoice_id);


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

    echo "Invoice";
    echo "
";
    echo json_encode($invoice, 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 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

{
    "id": "321",
    "invoice_id": "20170001",
    "contact_id": "0",
    "order_id": "0",
    "status": "unpaid",
    "type": "invoice",
    "subtotal": "8.26",
    "vat": "1.74",
    "total": "10",
    "currency": "EUR",
    "create_date": "2017-12-20",
    "expire_date": null,
    "contact_name": " Test",
    "last_name": "Test",
    "country": "NL",
    "paid_amount": "",
    "term_count": "1",
    "last_modified": "2017-12-20 20:49:28",
    "modified_by": "43549",
    "rows": [
        {
            "id": "1789",
            "row_id": "321",
            "product_id": "0",
            "product_type": "product",
            "description": "test",
            "amount": "1",
            "vat_procent": "21",
            "price": "8.26",
            "vat": "1.74",
            "subtotal": "8.26"
        }
    ]
}



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
4006
No invoice found
4007
No admin ID found
4008
No rights for this invoice
0%
()

Cancel upload