Accounting API
Invoices
Cancel Invoice
this api endpoint (post) (post) cancels an existing invoice and disables any future attempts to collect payment if the request succeeds, it returns an invoice object docid\ ebk zdbyuq96ennwbv l6 permissions invoices edit webhook event invoice events docid\ npa6n9frki q1e1yzvdbs path parameters id the id of the invoice to update body parameters products array of objects an array of objects each representing a product or invoice item that you wish to cancel leave empty if you are marking the full invoice as cancelled "products" \[ { "id" "9e51f934 8ff7 459e b5a6 a9ebc9bb2e1f" }, { "invoice item id" "b0249cb8 397a 4e2f 89db fe176f06e8b7" }, { "variation id" "zsad123 2bdc 47c0 abc0 1b5dfbd33ef1" } ] require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/invoices/cancel/c834d061 2bdc 47c0 abc0 1b5dfbd33ef1") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/invoices/cancel/c834d061 2bdc 47c0 abc0 1b5dfbd33ef1' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var requestoptions = { method 'post', headers myheaders }; fetch("https //api tamio com/v2/invoices/cancel/c834d061 2bdc 47c0 abc0 1b5dfbd33ef1", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "invoice" { "version" 2, "id" "12d71428 ae00 46e6 b79a ff9f15056568", "currency" "eur", "paid" false, "object" "invoice", "type" "custom", "prefix" "inv123", "number" 52, "total" 111, "payment" "cash", "date" 1670198400, "status" "new", "subscription" null, "is instalment" false, "merchant" { "address" "super street", "city" "frankfurt", "country" "de", "email" "super\@plugnpaid com", "name" "superstaff ltd", "postcode" "test", "state" null, "telephone" "+49123456789", "vat" null }, "locale" "en", "customer information" { "billing information" { "address" "awesome street", "city" "frankfurt", "country" "de", "email" "awesome\@example com", "id" "966a8470 8250 45d7 9ae7 aeaeffc30f28", "ip" null, "is company" false, "locale" "en", "name" "john", "object" "address", "phone" null, "postcode" null, "representative" null, "shipping address" false, "state" null }, "country" "de", "email" "awesome\@example com", "id" "9c91c6eb 9146 4bf5 82da dc73aba59a46", "locale" "en", "name" "john", "shipping information" { "address" "shipping street", "city" "frankfurt", "country" "de", "email" "shipping\@example com", "id" "ad5701b5 5470 44a3 9a56 af458f24f6b3", "locale" "sv", "name" "john doe ltd", "object" "address", "phone" "+123456678", "postcode" "123456", "representative" null, "shipping address" true, "state" null }, "stripe customer id" "cus mtonj9efexbggq" }, "products" \[ { "classification" "cell phones & accessories", "currency" "eur", "discount allowed" true, "discounts" \[], "ean" null, "has shipping" true, "id" "57d1897a b949 4dc8 947a d318b7d346c3", "is moss product" false, "is variant" false, "name" "big painting", "pack" null, "quantity" 1, "reservations" \[ { "negative stock" false, "preorder" false, "quantity" 1, "warehouse" "e30f69e5 76ba 4c6f 9b52 7bb40391b3bb" } ], "sku" null, "taxes" { "inclusive" true, "shipping tax rates" \[ { "id" null, "inclusive" true, "jurisdiction" "de", "label" "shipping taxes", "moss" false, "rate amount" null, "rate percent" 19, "tax" 1, "vat tax" true } ], "tax rates" \[ { "id" null, "inclusive" true, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 15, "vat tax" true } ] }, "totals" { "discount" 0, "exchange rate" null, "item total" 100, "item total with tax" 100, "moss tax total" 0, "moss taxable amount" 0, "price conversion" false, "shipping" 10, "shipping discount" 0, "shipping subtotal" 10, "shipping tax" 1, "shipping total" 11, "subtotal" 100, "tax" 15, "total" 111, "unit price" 100 }, "type" "physical product", "variation id" null } ], "discounts" \[], "licenses" \[], "start date" null, "end date" null, "totals" { "discount" 0, "item count" 1, "item total" 100, "item total with tax" 100, "moss tax total" 0, "moss taxable amount" 0, "price conversion" true, "shipping" 10, "shipping discount" 0, "shipping subtotal" 10, "shipping tax" 15, "shipping total" 10, "subtotal" 100, "tax" 15, "total" 110, "trial deductions" 0, "gateway fees" 0, "affiliate revenue" 0, "amount due" 110, "refunded total" 0 }, "taxes" { "has vat" true, "shipping tax rates" \[ { "applies to" \[ "57d1897a b949 4dc8 947a d318b7d346c3" ], "id" null, "inclusive" true, "jurisdiction" "de", "label" "shipping taxes", "moss" false, "rate amount" null, "rate percent" 19, "tax" 1, "vat tax" true } ], "tax rates" \[ { "applies to" \[ "57d1897a b949 4dc8 947a d318b7d346c3" ], "id" null, "inclusive" true, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 15, "vat tax" true } ] }, "shipping" { "method" "fedex", "tracking" null, "has shipping" true, "shipped" true }, "affiliate program" null, "affiliate partner" null, "due date" null, "refunds" null, "consents" null, "appendix" null } }