custom_field

Description

For a transaction, a custom field is historical record of the custom field added to a transaction during checkout. When created during the original transaction, they are also duplicated as transaction attributes. Custom fields can be added, removed and modified after a transaction is complete.

Custom fields also exist on carts and multiship shipments.

Warning: in the future, custom fields may be removed, so it's advised to use attributes for reporting purposes.

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 custom_field
PATCH
Update a custom_field (send only the properties you want to modify)
PUT
Replace a custom_field (send the entire representation)
DELETE
Delete a custom_field
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
name The name of the custom field. String Required. 100 characters or less.
value The value of this custom field. String Required. 700 characters or less.
is_hidden Whether or not this custom field is visible on the receipt and email receipt. This correlates to custom fields with a "h:" prefix when added to the cart. Boolean true or false, 1 or 0.
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/transaction_custom_fields/821",
            "title": "This Custom Field"
        },
        "fx:store": {
            "href": "https://api-sandbox.foxycart.com/stores/66",
            "title": "This Store"
        },
        "fx:transaction": {
            "href": "https://api-sandbox.foxycart.com/transactions/3862",
            "title": "This Transaction"
        }
    },
    "name": "Marketing_Opt_In",
    "value": "1",
    "is_hidden": false,
    "date_created": null,
    "date_modified": null
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api-sandbox.foxycart.com/transaction_custom_fields/821" rel="https://api.foxycart.com/rels/custom_field">
  <link rel="self" href="https://api-sandbox.foxycart.com/transaction_custom_fields/821" title="This Custom Field"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api-sandbox.foxycart.com/stores/66" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/transaction" href="https://api-sandbox.foxycart.com/transactions/3862" title="This Transaction"/>
  <name>Marketing_Opt_In</name>
  <value>1</value>
  <is_hidden>false</is_hidden>
  <date_created></date_created>
  <date_modified></date_modified>
</resource>
{
    "class": [
        "custom_field"
    ],
    "properties": {
        "name": "Marketing_Opt_In",
        "value": "1",
        "is_hidden": false,
        "date_created": null,
        "date_modified": null
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api-sandbox.foxycart.com/transaction_custom_fields/821"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api-sandbox.foxycart.com/stores/66"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/transaction"
            ],
            "href": "https://api-sandbox.foxycart.com/transactions/3862"
        }
    ]
}

Zoomable Resources

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