template_config

Description

The Template Config allows you to configure a lot of the template parameters use for displaying the cart, checkout, receipt and email pages for your store. The data used by Twig has some configuration values that can be adjusted here. This is for advanced use only and if you're not sure how this all works, please modify these settings via the FoxyCart admin instead of with the hAPI.

Each template set is linked to a specific template_config. The json property of the template config is where all of these values are stored. We'll explain these values as the exist today in greater detail, but please know these values may change over time and the current contract is not set in stone. The best approach when working with this data is to pull the latest values, make any changes you need, and then save them back again with a PATCH.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

GET
View a template_config
PATCH
Update a template_config (send only the properties you want to modify)
PUT
Replace a template_config (send the entire representation)
DELETE
Delete a template_config
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
description The description of your template config. String Required. 100 characters or less. Defaults to Template Config.
json This is the template configuration settings for your store. JSON Required.
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

json Properties as of 2017-04-17

Property Description Type Constraints
cart_type Controls how your cart functions. String Required. default, fullpage, or custom
checkout_type Determines how you'd like customers to interact with your checkout regarding guest checkout or account checkout. The default value shows which option is shown first by default. String Required. default_account, default_guest, guest_only, or account_only
csc_requirements Sets under what circumstances the card security code should be required. String Required. all_cards, sso_only, new_cards_only
tos_checkbox_settings Determines if you'd like a terms of service checkbox and url on your checkout. The usage can be none, required, or optional. The initial state can be checked or unchecked. is_hidden is a boolean you can use to use a hidden custom field. Url is the url of your terms of service document. Array Required. Array keys: usage, initial_state, is_hidden, url
eu_secure_data_transfer_consent Display a Secure Data Transfer agreement to EU customers. The usage can be none or required. Array Required. Array keys: usage
newsletter_subscribe Display a newsletter subscribe checkbox on your checkout. The usage can be none or required. Array Required. Array keys: usage
analytics_config Determine if you'd like to use an analytics service. The usage can be none or required. google_analytics is another array with usage, account_id, and include_on_site (boolean), google_tag is another array with usage, account_id, and send_to Array Required. Array keys: usage, google_analytics, google_tag
colors Can be used to set some basic colors for your cart, checkout, and receipt templates. The usage can be none or required. The primary, secondary, and tertiary values should be RGB color codes without the hash such as FFFFFF. Array Required. Array keys: usage, primary, secondary, and tertiary
use_checkout_confirmation_window Not currently implemented. The usage can be none or required. Array Required. Array keys: usage
supported_payment_cards Add the payment card types you support and want displayed on the checkout page. Array Required. Array value options: visa, mastercard, discover, amex, dinersclub, maestro, and laser
custom_checkout_field_requirements Customize which fields should be required, option, hidden or default on the checkout page. cart_controls (values enabled or disabled) determines if someone can remove or change the quantity of an item on the checkout. coupon_entry (values enabled or disabled) determines if the checkout page should include the coupon entry field. The other billing fields determines how those fields are used on the checkout. Array Required. Array keys: cart_controls, coupon_entry, billing_first_name, billing_last_name, billing_company, billing_tax_id, billing_phone, billing_address1, billing_address2, billing_city, billing_region, billing_postal_code, billing_country
cart_display_config Customize which fields in the cart are shown are hidden. The usage can be none or required. The named fields are booleans (either true or false) and hidden_product_options is an array of custom product option names you specify. Array Required. Array keys: usage, show_product_weight, show_product_category, show_product_code, show_product_options, show_sub_frequency, show_sub_startdate, show_sub_nextdate, show_sub_enddate, hidden_product_options
foxycomplete Allows you to customize and control the functionality of our find-as-you type system from countries and regions. The usage can be none or required. show_combobox and show_flags are booleans while combobox_open and combobox_close are the characters used for the combo box styling. Array Required. Array keys: usage, show_combobox, combobox_open, combobox_close, show_flags
custom_script_values Custom HTML, css, and JavaScript for your cart, checkout and receipt templates. Twig is not allowed in the header template. Array Required. Array keys: header, footer, checkout_fields, multiship_checkout_fields
http_receipt (Deprecated) This field is deprecated and should not be relied on. Boolean
custom_config A place where you can store your own custom JSON configuration data to be used by your Twig templates. JSON Optional.
debug The usage can be none or required Array Required. Array keys: usage
location_filtering This controls which countries and regions you want to allow on your cart and checkout pages. The usage can be none, shipping, billing, both, or independent. The filter types can be blacklist or whitelist. The filter values are objects with the cc2 attribute from the country as key and a list of the c attribute of regions as values (e.g. shipping_filter_values":{"US":["AL", "TX"]}). Use * to set all regions (e.g. shipping_filter_values":{"US":"*"}) Array Required. Array keys: usage, shipping_filter_type, billing_filter_type, shipping_filter_values, billing_filter_values
postal_code_lookup The usage can be none or enabled Array Required. Array keys: usage

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api-sandbox.foxycart.com/template_configs/14",
            "title": "This Template Config"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/8",
            "title": "This Store"
        },
        "fx:template_sets": {
            "href": "https://api-sandbox.foxycart.com/template_configs/14/template_sets",
            "title": "Template Sets using this template config"
        }
    },
    "description": "Template Config",
    "json": "{\"cart_type\":\"default\",\"checkout_type\":\"default_account\",\"csc_requirements\":\"all_cards\",\"tos_checkbox_settings\":{\"usage\":\"none\",\"initial_state\":\"unchecked\",\"is_hidden\":false,\"url\":\"\"},\"eu_secure_data_transfer_consent\":{\"usage\":\"required\"},\"newsletter_subscribe\":{\"usage\":\"none\"},\"analytics_config\":{\"usage\":\"none\",\"google_analytics\":{\"usage\":\"none\",\"account_id\":\"\",\"include_on_site\":false},\"google_tag\":{\"usage\":\"none\",\"account_id\":\"\",\"send_to\":""},\"segment_io\":{\"usage\":\"none\",\"account_id\":\"\"}},\"colors\":{\"usage\":\"none\",\"primary\":\"4D4D4D\",\"secondary\":\"FFFFFF\",\"tertiary\":\"FFFFFF\"},\"use_checkout_confirmation_window\":{\"usage\":\"none\"},\"supported_payment_cards\":[\"visa\",\"mastercard\",\"discover\",\"amex\"],\"custom_checkout_field_requirements\":{\"cart_controls\":\"enabled\",\"coupon_entry\":\"enabled\",\"billing_first_name\":\"required\",\"billing_last_name\":\"required\",\"billing_company\":\"optional\",\"billing_tax_id\":\"hidden\",\"billing_phone\":\"optional\",\"billing_address1\":\"required\",\"billing_address2\":\"optional\",\"billing_city\":\"required\",\"billing_region\":\"default\",\"billing_postal_code\":\"required\",\"billing_country\":\"required\"},\"cart_display_config\":{\"usage\":\"none\",\"show_product_weight\":true,\"show_product_category\":true,\"show_product_code\":true,\"show_product_options\":true,\"show_sub_frequency\":true,\"show_sub_startdate\":true,\"show_sub_nextdate\":true,\"show_sub_enddate\":true,\"hidden_product_options\":[]},\"foxycomplete\":{\"usage\":\"required\",\"show_combobox\":true,\"combobox_open\":\"\\u25bc\",\"combobox_close\":\"\\u25b2\",\"show_flags\":true},\"custom_script_values\":{\"header\":\"\",\"footer\":\"\",\"checkout_fields\":\"\",\"multiship_checkout_fields\":\"\"},\"http_receipt\":false,\"custom_config\":{},\"debug\":{\"usage\":\"none\"},\"location_filtering\":{\"usage\":\"none\",\"shipping_filter_type\":\"blacklist\",\"billing_filter_type\":\"blacklist\",\"shipping_filter_values\":{},\"billing_filter_values\":{}},\"postal_code_lookup\":{\"usage\":\"enabled\"}}",
    "date_created": "2012-08-10T11:58:54-0700",
    "date_modified": "2012-08-10T11:58:54-0700"
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api-sandbox.foxycart.com/template_configs/14" rel="https://api.foxycart.com/rels/template_config">
  <link rel="self" href="https://api-sandbox.foxycart.com/template_configs/14" title="This Template Config"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api-sandbox.foxycart.com/stores/8" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/template_sets" href="https://api-sandbox.foxycart.com/template_configs/14/template_sets" title="Template Sets using this template config"/>
  <description>Template Config</description>
  <json>{"cart_type":"default","checkout_type":"default_account","csc_requirements":"all_cards","tos_checkbox_settings":{"usage":"none","initial_state":"unchecked","is_hidden":false,"url":""},"eu_secure_data_transfer_consent":{"usage":"required"},"newsletter_subscribe":{"usage":"none"},"analytics_config":{"usage":"none","google_analytics":{"usage":"none","account_id":"","include_on_site":false},"google_tag":{"usage":"none","account_id":"","send_to":""},"segment_io":{"usage":"none","account_id":""}},"colors":{"usage":"none","primary":"4D4D4D","secondary":"FFFFFF","tertiary":"FFFFFF"},"use_checkout_confirmation_window":{"usage":"none"},"supported_payment_cards":["visa","mastercard","discover","amex"],"custom_checkout_field_requirements":{"cart_controls":"enabled","coupon_entry":"enabled","billing_first_name":"required","billing_last_name":"required","billing_company":"optional","billing_tax_id":"hidden","billing_phone":"optional","billing_address1":"required","billing_address2":"optional","billing_city":"required","billing_region":"default","billing_postal_code":"required","billing_country":"required"},"cart_display_config":{"usage":"none","show_product_weight":true,"show_product_category":true,"show_product_code":true,"show_product_options":true,"show_sub_frequency":true,"show_sub_startdate":true,"show_sub_nextdate":true,"show_sub_enddate":true,"hidden_product_options":[]},"foxycomplete":{"usage":"required","show_combobox":true,"combobox_open":"u25bc","combobox_close":"u25b2","show_flags":true},"custom_script_values":{"header":"","footer":"","checkout_fields":"","multiship_checkout_fields":""},"http_receipt":false,"custom_config":{},"debug":{"usage":"none"},"location_filtering":{"usage":"none","shipping_filter_type":"blacklist","billing_filter_type":"blacklist","shipping_filter_values":{},"billing_filter_values":{}},"postal_code_lookup":{"usage":"enabled"}}</json>
  <date_created>2012-08-10T11:58:54-0700</date_created>
  <date_modified>2012-08-10T11:58:54-0700</date_modified>
</resource>
{
    "class": [
        "template_config"
    ],
    "properties": {
        "description": "Template Config",
        "json": "{\"cart_type\":\"default\",\"checkout_type\":\"default_account\",\"csc_requirements\":\"all_cards\",\"tos_checkbox_settings\":{\"usage\":\"none\",\"initial_state\":\"unchecked\",\"is_hidden\":false,\"url\":\"\"},\"eu_secure_data_transfer_consent\":{\"usage\":\"required\"},\"newsletter_subscribe\":{\"usage\":\"none\"},\"analytics_config\":{\"usage\":\"none\",\"google_analytics\":{\"usage\":\"none\",\"account_id\":\"\",\"include_on_site\":false},\"google_tag\":{\"usage\":\"none\",\"account_id\":\"\",\"send_to\":""},\"segment_io\":{\"usage\":\"none\",\"account_id\":\"\"}},\"colors\":{\"usage\":\"none\",\"primary\":\"4D4D4D\",\"secondary\":\"FFFFFF\",\"tertiary\":\"FFFFFF\"},\"use_checkout_confirmation_window\":{\"usage\":\"none\"},\"supported_payment_cards\":[\"visa\",\"mastercard\",\"discover\",\"amex\"],\"custom_checkout_field_requirements\":{\"cart_controls\":\"enabled\",\"coupon_entry\":\"enabled\",\"billing_first_name\":\"required\",\"billing_last_name\":\"required\",\"billing_company\":\"optional\",\"billing_tax_id\":\"hidden\",\"billing_phone\":\"optional\",\"billing_address1\":\"required\",\"billing_address2\":\"optional\",\"billing_city\":\"required\",\"billing_region\":\"default\",\"billing_postal_code\":\"required\",\"billing_country\":\"required\"},\"cart_display_config\":{\"usage\":\"none\",\"show_product_weight\":true,\"show_product_category\":true,\"show_product_code\":true,\"show_product_options\":true,\"show_sub_frequency\":true,\"show_sub_startdate\":true,\"show_sub_nextdate\":true,\"show_sub_enddate\":true,\"hidden_product_options\":[]},\"foxycomplete\":{\"usage\":\"required\",\"show_combobox\":true,\"combobox_open\":\"\\u25bc\",\"combobox_close\":\"\\u25b2\",\"show_flags\":true},\"custom_script_values\":{\"header\":\"\",\"footer\":\"\",\"checkout_fields\":\"\",\"multiship_checkout_fields\":\"\"},\"http_receipt\":false,\"custom_config\":{},\"debug\":{\"usage\":\"none\"},\"location_filtering\":{\"usage\":\"none\",\"shipping_filter_type\":\"blacklist\",\"billing_filter_type\":\"blacklist\",\"shipping_filter_values\":{},\"billing_filter_values\":{}},\"postal_code_lookup\":{\"usage\":\"enabled\"}}",
        "date_created": "2012-08-10T11:58:54-0700",
        "date_modified": "2012-08-10T11:58:54-0700"
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api-sandbox.foxycart.com/template_configs/14"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api-sandbox.foxycart.com/stores/8"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/template_sets"
            ],
            "href": "https://api-sandbox.foxycart.com/template_configs/14/template_sets"
        }
    ]
}

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.