Edit template code
/templates/{id}/edit_codeCosts 2 rate-limit points · Rate limits
Change part of a template's Liquid/HTML source (its liquid_code) without sending all of it: a list of exact find/replace edits, run in order. Each find must match the code exactly once, spaces and line breaks included; if any edit does not, nothing is saved and each failing edit is named (not found, or matched N times). Use it for a CSS colour, a label, a line of HTML. Returns the template in full and, per edit, the lines before and after.
Applies to every document generated from this template from now on; existing PDFs are unchanged. Saved as a template version, so it can be restored.
Also searched asedit template codechange the css in the templatechange a colour in the template htmlreplace text in the template liquidfix one line of the template codepatch the template
Path parameters
idstringRequiredTemplate id.
Request body
editsarray of objectsRequiredUp to 20 edits, each { find, replace }: find is text copied exactly from liquid_code and must match it once; replace is the new text ("" deletes it).
Show 2 child attributesHide child attributes
findstringRequiredExample:color: #333333;replacestringRequiredExample:color: #1a56db;
Returns
idintegerExample:113namestringExample:Main invoicedocument_typestringExample:invoicedesignobject, nullabledefault_forobjectShow 4 child attributesHide child attributes
ordersbooleanExample:falsedraft_ordersbooleanExample:falsepos_ordersbooleanExample:falsecredit_notesbooleanExample:false
logoobjectShow 4 child attributesHide child attributes
enabledbooleanExample:trueurlstring, nullablewidthintegerExample:150lock_aspect_ratiobooleanExample:true
created_atstringExample:2026-11-18T00:07:09Zupdated_atstringExample:2026-11-18T00:07:10ZstyleobjectShow 4 child attributesHide child attributes
accent_colorstringExample:#000000font_familystringExample:Arialfont_sizeintegerExample:12date_formatstringExample:MMM DD, YYYY
numberingobjectShow 5 child attributesHide child attributes
prefixstringExample:INVnext_numberstring, nullableuse_order_numberbooleanExample:truecredit_notes_use_order_numberbooleanExample:falsesequential_numbering_availablebooleanExample:true
sectionsobjectShow 8 child attributesHide child attributes
order_informationobjectShow 14 child attributesHide child attributes
show_invoice_numberbooleanExample:trueshow_custom_invoice_numberbooleanExample:falseshow_order_numberbooleanExample:trueshow_po_numberbooleanExample:falseshow_delivery_note_numberbooleanExample:falseshow_order_datebooleanExample:trueshow_issue_datebooleanExample:falseshow_due_datebooleanExample:falseshow_fulfillment_datebooleanExample:falseshow_payment_termsbooleanExample:falseshow_order_amountbooleanExample:trueshow_order_tagsbooleanExample:falseshow_barcodebooleanExample:falseshow_order_barcodebooleanExample:false
payment_informationobjectShow 10 child attributesHide child attributes
show_payment_addressbooleanExample:trueshow_payment_methodbooleanExample:trueshow_payment_breakdownbooleanExample:falseshow_credit_cardbooleanExample:trueshow_financial_statusbooleanExample:falseshow_discount_codebooleanExample:falseshow_tax_datebooleanExample:falseshow_tracking_companybooleanExample:falseshow_tracking_numbersbooleanExample:falseshow_paid_by_customerbooleanExample:true
shipping_informationobjectShow 1 child attributeHide child attributes
show_shipping_addressbooleanExample:true
customer_informationobjectShow 5 child attributesHide child attributes
show_customer_emailbooleanExample:trueshow_customer_phonebooleanExample:trueshow_customer_notebooleanExample:trueshow_localized_tax_idbooleanExample:falselocalized_tax_id_stringstringExample:Tax ID
itemsobjectShow 21 child attributesHide child attributes
show_product_imagesbooleanExample:trueshow_skubooleanExample:trueshow_hs_codebooleanExample:falseshow_product_weightbooleanExample:falseshow_total_product_weightbooleanExample:falseshow_country_of_originbooleanExample:falseshow_product_typebooleanExample:falseshow_product_descriptionbooleanExample:falseshow_note_attributesbooleanExample:falseshow_variantsbooleanExample:trueshow_selling_planbooleanExample:falseshow_item_discountbooleanExample:falseshow_discount_reasonbooleanExample:falseshow_compare_at_pricebooleanExample:falseshow_original_pricebooleanExample:falseshow_propertiesbooleanExample:trueshow_item_barcodebooleanExample:falseshow_total_qtybooleanExample:falseshow_item_taxbooleanExample:trueshow_item_tax_amountbooleanExample:truegroup_amount_digitsbooleanExample:false
order_totalobjectShow 16 child attributesHide child attributes
show_subtotalbooleanExample:trueshow_order_discountbooleanExample:trueshow_order_discount_reasonbooleanExample:falseshow_discount_breakdownbooleanExample:falseshow_taxbooleanExample:trueshow_tax_inclusion_labelbooleanExample:falseshow_tax_breakdownbooleanExample:trueshow_shippingbooleanExample:trueshow_discountsbooleanExample:trueshow_shipping_rate_namebooleanExample:trueshow_amount_in_wordsbooleanExample:falseshow_total_weightbooleanExample:falseshow_refund_amountbooleanExample:trueshow_refund_reasonbooleanExample:falseshow_payment_linkbooleanExample:falseshow_balancebooleanExample:true
extraobjectShow 6 child attributesHide child attributes
show_order_notesbooleanExample:trueshow_footer_notesbooleanExample:falsefooter_messagestring, nullableshow_store_domainbooleanExample:falsestore_domain_textstring, nullableshow_paid_unpaid_watermarkbooleanExample:false
socialobjectShow 4 child attributesHide child attributes
show_social_pagebooleanExample:falsefacebook_urlstring, nullableinstagram_urlstring, nullabletwitter_urlstring, nullable
label_overridesobjectcontent_translationsobjectliquid_codestringExample:<style> .title { color: #1a56db; } .total { color: #3…editsarray of objectsShow 3 child attributesHide child attributes
lineintegerExample:2beforestringExample:.title { color: #333333; }afterstringExample:.title { color: #1a56db; }
Errors
paid_plan_requiredv3_required: the shop still runs the previous dashboard. paid_plan_required: API access needs a paid plan.
not_foundThe resource does not exist for this shop, or no action is registered at this path.
The request failed validation. Nothing was saved.
Any request can also fail with unauthorized (401) or rate_limited (429).
Every error has the same shape: see Errors.
curl -X POST "https://app.invoicefalcon.com/api/v3/external/templates/125/edit_code" \
-H "X-Auth-Token: $INVOICE_FALCON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"edits": [
{
"find": "color: #333333;",
"replace": "color: #1a56db;"
}
]
}'const res = await fetch("https://app.invoicefalcon.com/api/v3/external/templates/125/edit_code", {
method: "POST",
headers: {
"X-Auth-Token": process.env.INVOICE_FALCON_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"edits": [
{
"find": "color: #333333;",
"replace": "color: #1a56db;"
}
]
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.invoicefalcon.com/api/v3/external/templates/125/edit_code",
headers={"X-Auth-Token": os.environ["INVOICE_FALCON_API_KEY"]},
json={
"edits": [
{
"find": "color: #333333;",
"replace": "color: #1a56db;"
}
]
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.invoicefalcon.com/api/v3/external/templates/125/edit_code")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["INVOICE_FALCON_API_KEY"], "Content-Type" => "application/json")
req.body = {
edits: [
{
find: "color: #333333;",
replace: "color: #1a56db;"
}
]
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"id": 113,
"name": "Main invoice",
"document_type": "invoice",
"design": null,
"default_for": {
"orders": false,
"draft_orders": false,
"pos_orders": false,
"credit_notes": false
},
"logo": {
"enabled": true,
"url": null,
"width": 150,
"lock_aspect_ratio": true
},
"created_at": "2026-11-18T00:07:09Z",
"updated_at": "2026-11-18T00:07:10Z",
"style": {
"accent_color": "#000000",
"font_family": "Arial",
"font_size": 12,
"date_format": "MMM DD, YYYY"
},
"numbering": {
"prefix": "INV",
"next_number": null,
"use_order_number": true,
"credit_notes_use_order_number": false,
"sequential_numbering_available": true
},
"sections": {
"order_information": {
"show_invoice_number": true,
"show_custom_invoice_number": false,
"show_order_number": true,
"show_po_number": false,
"show_delivery_note_number": false,
"show_order_date": true,
"show_issue_date": false,
"show_due_date": false,
"show_fulfillment_date": false,
"show_payment_terms": false,
"show_order_amount": true,
"show_order_tags": false,
"show_barcode": false,
"show_order_barcode": false
},
"payment_information": {
"show_payment_address": true,
"show_payment_method": true,
"show_payment_breakdown": false,
"show_credit_card": true,
"show_financial_status": false,
"show_discount_code": false,
"show_tax_date": false,
"show_tracking_company": false,
"show_tracking_numbers": false,
"show_paid_by_customer": true
},
"shipping_information": {
"show_shipping_address": true
},
"customer_information": {
"show_customer_email": true,
"show_customer_phone": true,
"show_customer_note": true,
"show_localized_tax_id": false,
"localized_tax_id_string": "Tax ID"
},
"items": {
"show_product_images": true,
"show_sku": true,
"show_hs_code": false,
"show_product_weight": false,
"show_total_product_weight": false,
"show_country_of_origin": false,
"show_product_type": false,
"show_product_description": false,
"show_note_attributes": false,
"show_variants": true,
"show_selling_plan": false,
"show_item_discount": false,
"show_discount_reason": false,
"show_compare_at_price": false,
"show_original_price": false,
"show_properties": true,
"show_item_barcode": false,
"show_total_qty": false,
"show_item_tax": true,
"show_item_tax_amount": true,
"group_amount_digits": false
},
"order_total": {
"show_subtotal": true,
"show_order_discount": true,
"show_order_discount_reason": false,
"show_discount_breakdown": false,
"show_tax": true,
"show_tax_inclusion_label": false,
"show_tax_breakdown": true,
"show_shipping": true,
"show_discounts": true,
"show_shipping_rate_name": true,
"show_amount_in_words": false,
"show_total_weight": false,
"show_refund_amount": true,
"show_refund_reason": false,
"show_payment_link": false,
"show_balance": true
},
"extra": {
"show_order_notes": true,
"show_footer_notes": false,
"footer_message": null,
"show_store_domain": false,
"store_domain_text": null,
"show_paid_unpaid_watermark": false
},
"social": {
"show_social_page": false,
"facebook_url": null,
"instagram_url": null,
"twitter_url": null
}
},
"label_overrides": {},
"content_translations": {},
"liquid_code": "<style>\n .title { color: #1a56db; }\n .total { color: #333333; }\n</style>\n<h1 class=\"title\">{{ translations.title }}</h1>\n",
"edits": [
{
"line": 2,
"before": " .title { color: #333333; }",
"after": " .title { color: #1a56db; }"
}
]
}{
"errors": [
"Invalid API key"
],
"code": "unauthorized"
}{
"errors": [
"API access requires a paid plan"
],
"code": "paid_plan_required"
}{
"errors": [
"Resource not found"
],
"code": "not_found"
}{
"errors": [
"id is missing"
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited"
}