Accounting API
Invoices
Affiliate Commission
path parameters id the id of the invoice body parameters commission integer the commission to credit to the affiliate affiliate string the id of the affiliate to assign the invoice to note to deduct any existing commission from the invoice, create the request with an empty body require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/invoices/affiliate commission/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 = { affiliate "a364d978 17c6 47e2 8812 5222bae71219", commission 1 } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/invoices/affiliate commission/c834d061 2bdc 47c0 abc0 1b5dfbd33ef1' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "affiliate" "a364d978 17c6 47e2 8812 5222bae71219", "commission" 1 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { affiliate "a364d978 17c6 47e2 8812 5222bae71219", commission 1 }; var body = json stringify(data); fetch("https //api tamio com/v2/invoices/affiliate commission/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" "f59a3fa2 b708 419c a572 5f7250b18f3a", "currency" "eur", "paid" true, "object" "invoice", "type" "checkout", "prefix" "invpr", "number" 587, "total" 51537, "payment" "stripe", "date" 1670857723, "status" "new", "subscription" null, "is instalment" false, "merchant" { "address" "awesome street", "city" "frankfurt", "country" "de", "email" "merchant\@example com", "name" "awesome ltd", "postcode" "60123", "state" null, "telephone" "+49875215446", "vat" null }, "locale" "en", "customer information" { "billing information" { "address" "jane doe street", "city" "copenhagen", "country" "dk", "email" "john\@example com", "id" "83ce060b 80e3 41d2 87a9 d723e9657a00", "ip" null, "is company" false, "locale" "en", "name" "john doe", "object" "address", "phone" null, "postcode" "abc1234", "representative" null, "shipping address" false, "state" null }, "country" "dk", "email" "john\@example com", "id" "a38f68fb 23f8 409d 93d4 86386a0e6441", "last name" "doe", "locale" "en", "name" "john", "shipping information" { "address" "my address", "city" "sydney", "country" "au", "email" "shipping\@example com", "id" "7420c3a7 9849 4b3e 888f e338236e609a", "locale" "en", "name" "asdasdasd", "object" "address", "phone" null, "postcode" null, "representative" null, "shipping address" true, "state" null }, "stripe customer id" "cus mtqtejhzzql9in" }, "products" \[ { "classification" "general", "currency" "eur", "discount allowed" true, "discounts" \[ { "coupon" null, "discount" 2412, "duration" 0, "id" "842f6ac8 b34e 46e7 a3f1 8fbf4d15aea6", "shipping discount" 2400 } ], "ean" null, "has shipping" true, "id" "23394936 4a08 4622 b357 3a0fcd7d2b5b", "is moss product" false, "is variant" false, "name" "physical product", "pack" null, "quantity" 2, "reservations" \[ { "negative stock" false, "preorder" false, "quantity" 2, "warehouse" null } ], "sku" null, "taxes" { "inclusive" false, "shipping tax rates" \[ { "id" null, "inclusive" false, "jurisdiction" "de", "label" "shipping taxes", "moss" false, "rate amount" null, "rate percent" 19, "tax" 4104, "vat tax" true } ], "tax rates" \[ { "id" null, "inclusive" false, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 4125, "vat tax" true } ] }, "totals" { "discount" 2412, "exchange rate" null, "item total" 21708, "item total with tax" 25833, "moss tax total" 0, "moss taxable amount" 0, "price conversion" false, "shipping" 21600, "shipping discount" 2400, "shipping subtotal" 24000, "shipping tax" 4104, "shipping total" 25704, "subtotal" 24120, "tax" 4125, "total" 51537, "unit price" 12060 }, "type" "physical product", "variation id" null } ], "discounts" \[ { "applies to" \[ "23394936 4a08 4622 b357 3a0fcd7d2b5b" ], "coupon" null, "discount" 2412, "duration" 0, "id" "842f6ac8 b34e 46e7 a3f1 8fbf4d15aea6", "shipping discount" 2400 } ], "licenses" \[], "start date" null, "end date" null, "totals" { "discount" 2412, "item count" 2, "item total" 21708, "item total with tax" 25833, "moss tax total" 0, "moss taxable amount" 0, "price conversion" true, "shipping" 21600, "shipping discount" 2400, "shipping subtotal" 24000, "shipping tax" 4104, "shipping total" 25704, "subtotal" 24120, "tax" 4125, "total" 51537, "trial deductions" 0, "gateway fees" 1520, "affiliate revenue" 1000, "amount due" 0, "refunded total" 0 }, "taxes" { "has vat" true, "shipping tax rates" \[ { "applies to" \[ "23394936 4a08 4622 b357 3a0fcd7d2b5b" ], "id" null, "inclusive" false, "jurisdiction" "de", "label" "shipping taxes", "moss" false, "rate amount" null, "rate percent" 19, "tax" 4104, "vat tax" true } ], "tax rates" \[ { "applies to" \[ "23394936 4a08 4622 b357 3a0fcd7d2b5b" ], "id" null, "inclusive" false, "jurisdiction" "de", "label" "mwst ", "moss" false, "rate amount" null, "rate percent" 19, "tax" 4125, "vat tax" true } ] }, "shipping" { "method" "new shipping method", "tracking" null, "has shipping" true, "shipped" false }, "affiliate program" "040afdd0 3081 4712 b827 896b3b7cbfa7", "affiliate partner" "b527f3c7 08cb 4faa 8fd6 b3ede6ada91f", "due date" null, "refunds" null, "consents" null, "appendix" null } }