Accounting API
Invoices
Refund Invoice
this api endpoint (post) (post) refunds an existing invoice if the request succeeds, it returns an invoice object docid\ ebk zdbyuq96ennwbv l6 depending on the payment method, the refund will either be finalised automatically online or manually offline permissions invoices edit webhook event invoice events docid\ npa6n9frki q1e1yzvdbs currently, automated online refunds are supported for credit cards (stripe), ideal, sofort, sepa, bancontact, p24 and giropay path parameters id the id of the invoice to refund body parameters amount integer the amount to refund in cents reason string the possible values are requested by customer , duplicate , fraudulent and other products array of objects an array of objects each representing a product or invoice item that you wish to mark as refunded leave empty if you are marking the full invoice as refunded "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/refund/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" data = { amount 500, reason "duplicate" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/invoices/refund/c834d061 2bdc 47c0 abc0 1b5dfbd33ef1' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "amount" 1, "reason" "duplicate" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { amount 1, reason "duplicate" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/invoices/refund/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" "c7a5d26f 34e8 4ce0 812a a483fb08a7ce", "currency" "eur", "paid" true, "object" "invoice", "type" "recurring", "prefix" "invpr", "number" 53, "total" 1000, "payment" "stripe", "date" 1670889600, "status" "partial refund", "subscription" "8f6ae599 5809 4ed9 b2c4 1213e11982a3", "is instalment" false, "merchant" { "address" "super street", "city" "frankfurt", "country" "de", "email" "superltd\@example com", "name" "superstaff ltd", "postcode" "asdasdasdsa", "state" null, "telephone" "+49123456789", "vat" null }, "locale" "en", "customer information" { "billing information" { "address" "asdsadsads", "city" "asdasdasd", "country" "de", "email" "mike\@example com", "id" "d51b7096 2a38 47d1 94ff 6c5942763228", "ip" null, "is company" false, "locale" "en", "name" "mike", "object" "address", "phone" "+123456789", "postcode" null, "representative" null, "shipping address" false, "state" null }, "country" "de", "email" "mike\@example com", "id" "ecd97edb 9799 452d bc18 d7b70374d8b4", "last name" "doe", "locale" "en", "name" "mike", "stripe customer id" "cus mtqxjc9mbma759" }, "products" \[ { "billing cycle" "month", "classification" "recurring invoice item", "currency" "eur", "discount allowed" true, "discounts" \[], "ean" null, "has shipping" false, "id" "686e231a e9b1 4e6b 85f3 a764beb4045a", "interval" 1, "is metered" null, "is moss product" true, "is variant" false, "name" "invoice item", "pack" null, "quantity" 1, "reservations" \[], "sku" null, "stripe price id" "price 1mekmaeje1uz2ukgdetzllkq", "taxes" { "inclusive" true, "shipping tax rates" \[], "tax rates" \[ { "id" null, "inclusive" true, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 160, "vat tax" true } ] }, "totals" { "discount" 0, "exchange rate" null, "item total" 1000, "item total with tax" 1000, "moss tax total" 0, "moss taxable amount" 0, "price conversion" false, "shipping" 0, "shipping discount" 0, "shipping subtotal" 0, "shipping tax" 0, "shipping total" 0, "subtotal" 1000, "tax" 160, "total" 1000, "unit price" 1000 }, "trial period" 0, "type" "billing plan", "variation id" null } ], "discounts" \[], "licenses" \[], "start date" null, "end date" null, "totals" { "discount" 0, "item count" 1, "item total" 1000, "item total with tax" 1000, "moss tax total" 0, "moss taxable amount" 0, "price conversion" true, "shipping" 0, "shipping discount" 0, "shipping subtotal" 0, "shipping tax" 0, "shipping total" 0, "subtotal" 1000, "tax" 160, "total" 1000, "trial deductions" 0, "gateway fees" 54, "affiliate revenue" 0, "amount due" 0, "refunded total" 500 }, "taxes" { "has vat" true, "shipping tax rates" \[], "tax rates" \[ { "applies to" \[ "686e231a e9b1 4e6b 85f3 a764beb4045a" ], "id" null, "inclusive" true, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 160, "vat tax" true } ] }, "shipping" null, "affiliate program" null, "affiliate partner" null, "due date" null, "consents" null, "appendix" null } }