Invoices
Undo annulment
Reverses a previous annulment and restores the invoice to its prior state.
DELETE
/
v1
/
invoices
/
{invoiceId}
/
annulment
Undo annulment
curl --request DELETE \
--url https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment"
headers = {"x-api-token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment', 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}/annulment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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}/annulment"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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": "<string>"
}{
"code": "customer-invoice/not-found"
}Restores an annulled invoice by removing the reversing transactions. The invoice’s original fiscal year and VAT period must still be editable.
Authorizations
API token for authentication. Obtain from your Infinity account settings.
Path Parameters
The id of the invoice.
Response
The annulment was successfully undone.
The full representation of a customer invoice.
Show child attributes
Show child attributes
Previous
Find estimatesFinds matching estimates (quotes) in the organisation. Returns slim preview objects suitable for listings.
Next
⌘I
Undo annulment
curl --request DELETE \
--url https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment \
--header 'x-api-token: <api-key>'import requests
url = "https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment"
headers = {"x-api-token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-token': '<api-key>'}};
fetch('https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment', 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}/annulment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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}/annulment"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infinity.swiss/v1/invoices/{invoiceId}/annulment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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": "<string>"
}{
"code": "customer-invoice/not-found"
}