template_config

Collection: template_configs

The Template Config allows you to configure a lot of the template parameters used 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. 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.

Notes

The json property contains the following sub-properties (as of 2017-04-17):

  • cart_type: Controls how your cart functions. Values: default, fullpage, or custom.
  • checkout_type: Determines guest vs account checkout. Values: default_account, default_guest, guest_only, or account_only.
  • csc_requirements: When the card security code is required. Values: all_cards, sso_only, new_cards_only.
  • tos_checkbox_settings: Terms of service checkbox config. Keys: usage, initial_state, is_hidden, url.
  • eu_secure_data_transfer_consent: EU Secure Data Transfer agreement. Keys: usage.
  • newsletter_subscribe: Newsletter subscribe checkbox. Keys: usage.
  • analytics_config: Analytics service configuration. Keys: usage, google_analytics, google_tag.
  • colors: Basic color settings. Keys: usage, primary, secondary, tertiary.
  • use_checkout_confirmation_window: Not currently implemented. Keys: usage.
  • supported_payment_cards: Payment card types displayed on checkout. Values: visa, mastercard, discover, amex, dinersclub, maestro, laser.
  • custom_checkout_field_requirements: Field requirement customization. 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: Cart field display config. 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: Find-as-you-type system config. Keys: usage, show_combobox, combobox_open, combobox_close, show_flags.
  • custom_script_values: Custom HTML/CSS/JS. Keys: header, footer, checkout_fields, multiship_checkout_fields.
  • http_receipt (Deprecated): Should not be relied on.
  • custom_config: Custom JSON configuration data for your Twig templates.
  • debug: Debug mode. Keys: usage.
  • location_filtering: Country and region filtering. Keys: usage, shipping_filter_type, billing_filter_type, shipping_filter_values, billing_filter_values.
  • postal_code_lookup: Postal code lookup. Keys: usage.

Required Scopes

Full store_full_access
Read templates_read
Write templates_write

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 (4)

description String

The description of your template config. Required. 100 characters or less. Defaults to Template Config.

json String

This is the template configuration settings for your store, stored as a JSON string. See the notes section for all available sub-properties.

date_created String (nullable) · Read-only

The date this resource was created.

date_modified String (nullable) · Read-only

The date this resource was last modified.

Link Relations (3)

self This Template Config
fx:store GET PATCH PUT DELETE This Store
fx:template_sets GET POST Template Sets using this template config
https://api.foxycart.com/template_configs/{id}
Available via fx:template_config on template_set

Example Representation

{
  "_links": {
    "curies": [
      {
        "name": "fx",
        "href": "https://api.foxycart.com/rels/{rel}",
        "templated": true
      }
    ],
    "self": {
      "href": "https://api.foxycart.com/template_configs/123",
      "title": "This Template Config"
    },
    "fx:store": {
      "href": "https://api.foxycart.com/stores/456",
      "title": "This Store"
    },
    "fx:template_sets": {
      "href": "https://api.foxycart.com/template_configs/123/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\":\"\"}},\"colors\":{\"usage\":\"none\",\"primary\":\"4D4D4D\",\"secondary\":\"FFFFFF\",\"tertiary\":\"FFFFFF\"},\"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\"},\"foxycomplete\":{\"usage\":\"required\",\"show_combobox\":true,\"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"
}