Invoices
Get specific invoice
Returns the full representation of an invoice by id.
GET
/
v1
/
invoices
/
{invoiceId}
Get specific invoice
curl --request GET \
--url https://api.infinity.swiss/v1/invoices/{invoiceId} \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/invoices/{invoiceId}"
headers = {"x-api-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.infinity.swiss/v1/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.infinity.swiss/v1/invoices/{invoiceId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.infinity.swiss/v1/invoices/{invoiceId}")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/invoices/{invoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "<string>",
"isDraft": true,
"number": "<string>",
"organisation": "<string>",
"template": "<string>",
"openingDate": "2023-12-25",
"dueDate": "2023-12-25",
"positions": [
{
"type": "product",
"name": "<string>",
"singleAmount": 12000,
"quantity": 2,
"contraAccount": 5499,
"id": "<string>",
"unit": "<string>",
"taxCode": "",
"articleNumber": "<string>",
"description": "<string>",
"date": "<string>",
"discountRate": 50,
"customTextColumns": {
"customTextColumn1": "<string>",
"customTextColumn2": "<string>",
"customTextColumn3": "<string>"
},
"totalAmount": 123,
"vatDebt": 123,
"originalCurrency": "<string>",
"exchangeRate": 123
}
],
"totalAmount": 123,
"totalNetAmount": 123,
"totalVatDebt": 123,
"isQrInvoice": true,
"totalAmountPaid": 123,
"totalRestAmount": 123,
"isPaid": true,
"isOverpaid": true,
"isAnnulled": true,
"recipient": "<string>",
"customRecipientText": "<string>",
"title": "<string>",
"payableInDays": 123,
"introductoryText": "<string>",
"closingText": "<string>",
"originalCurrency": "<string>",
"exchangeRate": 123,
"columns": [],
"emailDeliveries": [
{
"recipientEmail": "jsmith@example.com",
"status": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"publicPdfUrl": "<string>"
}
}{
"code": "general/unauthorised"
}{
"code": "customer-invoice/not-found"
}Authorizations
API token for authentication. Obtain from your Infinity account settings.
Path Parameters
The id of the specific invoice.
Response
The invoice is returned.
The full representation of a customer invoice.
Show child attributes
Show child attributes
Previous
Create invoiceCreates a new customer invoice in the organisation. Set `isDraft` to `false` to immediately post the invoice and create the underlying transactions.
Next
⌘I
Get specific invoice
curl --request GET \
--url https://api.infinity.swiss/v1/invoices/{invoiceId} \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/invoices/{invoiceId}"
headers = {"x-api-token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/invoices/{invoiceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.infinity.swiss/v1/invoices/{invoiceId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.infinity.swiss/v1/invoices/{invoiceId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.infinity.swiss/v1/invoices/{invoiceId}")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/invoices/{invoiceId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"invoice": {
"id": "<string>",
"isDraft": true,
"number": "<string>",
"organisation": "<string>",
"template": "<string>",
"openingDate": "2023-12-25",
"dueDate": "2023-12-25",
"positions": [
{
"type": "product",
"name": "<string>",
"singleAmount": 12000,
"quantity": 2,
"contraAccount": 5499,
"id": "<string>",
"unit": "<string>",
"taxCode": "",
"articleNumber": "<string>",
"description": "<string>",
"date": "<string>",
"discountRate": 50,
"customTextColumns": {
"customTextColumn1": "<string>",
"customTextColumn2": "<string>",
"customTextColumn3": "<string>"
},
"totalAmount": 123,
"vatDebt": 123,
"originalCurrency": "<string>",
"exchangeRate": 123
}
],
"totalAmount": 123,
"totalNetAmount": 123,
"totalVatDebt": 123,
"isQrInvoice": true,
"totalAmountPaid": 123,
"totalRestAmount": 123,
"isPaid": true,
"isOverpaid": true,
"isAnnulled": true,
"recipient": "<string>",
"customRecipientText": "<string>",
"title": "<string>",
"payableInDays": 123,
"introductoryText": "<string>",
"closingText": "<string>",
"originalCurrency": "<string>",
"exchangeRate": 123,
"columns": [],
"emailDeliveries": [
{
"recipientEmail": "jsmith@example.com",
"status": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"publicPdfUrl": "<string>"
}
}{
"code": "general/unauthorised"
}{
"code": "customer-invoice/not-found"
}