GET
https://camping.care/api/v1/invoicing/id
Autorication:
Get a specific invoice by id.
Parameters
ReplaceResponse
201
application/json; charset=utf-8
Integer
The id of the invoice
Integer
The invoice id of the administration
Integer
The id of the contact for this invoice
Integer
The order id of the invoice
String
The status of the payment of the invoice in a string: with status draft, paid, unpaid, partly_paid, removed, concept
String
The type of the invoice in a string of type 'invoice', 'offer'
Double
Subtotal amount of the invoice
Double
vat of the invoice
Double
Total amount of the invoice
String
Currency of the reservation in currencies: EUR, USD, GBP, CHF
Date
The creation date of the invoice
Date
The expire date of the invoice
String
The contact name for the invoice
String
The last name of the contact
String
The country of the contact
String
The amount paid of the invoice
String
Nr of terms the invoice has to be paid
String
last modified date of the invoice
String
modified by user id
Array
Array of invoice rows
Int
id of invoice row
Int
id of invoice
Int
id of product for invoice
Int
product type of invoice
String
description of invoice row
String
amount for current invoice row
Double
Vat amount percentage
Double
Price for current row
Double
Calculated Vat for current row
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
Integer
The error code listed in a list below
String
The error message listed in a list below
Error Codes
4000
4006
4007
4008
4000
4006
4007
4008