cart_template

Description

The Cart Template contains the Twig content used to display the full page cart for your store. To use the default responsive theme, leave the content property empty. If you want to set your own template content, configure a content_url and then POST to the cache link relationship to cache your store's cart template. This will run your content through our caching system which will rewrite all the JavaScript, CSS, and HTML to cache images securely on our servers.

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 cart_template
PATCH
Update a cart_template (send only the properties you want to modify)
PUT
Replace a cart_template (send the entire representation)
DELETE
Delete a cart_template
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 cart template. String Required. 100 characters or less. Defaults to Cart Template.
content The content of your cart template. Leave blank to use the default responsive template. This shouldn't be set directly unless all of your image references are already over https. If they are not, set the content_url to point to your template content online and then POST to the cache link relationship. String Optional
content_url The URL of your cart template hosted on your own server online and publicly available for our server to cache. URL Optional. 300 characters or less.
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api-sandbox.foxycart.com/cart_templates/14",
            "title": "This Template"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/8",
            "title": "This Store"
        },
        "fx:template_sets": {
            "href": "https://api-sandbox.foxycart.com/cart_templates/14/template_sets",
            "title": "Template Sets using this template"
        },
        "fx:cache": {
            "href": "https://api-sandbox.foxycart.com/cart_templates/14/cache",
            "title": "POST here to cache your template using the content_url"
        },
        "fx:encode": {
            "href": "https://api-sandbox.foxycart.com/encode",
            "title": "POST here to encode a body of html for use with our HMAC cart encryption."
        }
    },
    "description": "Cart Template",
    "content": "",
    "content_url": "",
    "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/cart_templates/14" rel="https://api.foxycart.com/rels/cart_template">
  <link rel="self" href="https://api-sandbox.foxycart.com/cart_templates/14" title="This Template"/>
  <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/cart_templates/14/template_sets" title="Template Sets using this template"/>
  <link rel="https://api.foxycart.com/rels/cache" href="https://api-sandbox.foxycart.com/cart_templates/14/cache" title="POST here to cache your template using the content_url"/>
  <link rel="https://api.foxycart.com/rels/encode" href="https://api-sandbox.foxycart.com/encode" title="POST here to encode a body of html for use with our HMAC cart encryption."/>
  <description>Cart Template</description>
  <content></content>
  <content_url></content_url>
  <date_created>2012-08-10T11:58:54-0700</date_created>
  <date_modified>2012-08-10T11:58:54-0700</date_modified>
</resource>
{
    "class": [
        "cart_template"
    ],
    "properties": {
        "description": "Cart Template",
        "content": "",
        "content_url": "",
        "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/cart_templates/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/cart_templates/14/template_sets"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/cache"
            ],
            "href": "https://api-sandbox.foxycart.com/cart_templates/14/cache"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/encode"
            ],
            "href": "https://api-sandbox.foxycart.com/encode"
        }
    ]
}

Zoomable Resources

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