custom_fields
Description
This link relationship returns a collection of resources. You can easily paginate through this collection using the hypermedia links provided and the link relationships of first, prev, next, and last. Scroll down to view a representation of a single resource embedded within this collection.
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 list of custom_fields
- POST
- Create a new custom_field
- HEAD
- Get just the header response
- OPTIONS
- Get a response explaining which HTTP methods are supported
Example Representation
{ "_links": { "curies": [ { "name": "fx", "href": "https://api.foxycart.com/rels/{rel}", "templated": true } ], "self": { "href": "...", "title": "This Collection" }, "first": { "href": "...?offset=0", "title": "First Page of this Collection" }, "prev": { "href": "...?offset=0", "title": "Previous Page of this Collection" }, "next": { "href": "...?offset=0", "title": "Next Page of this Collection" }, "last": { "href": "...?offset=0", "title": "Last Page of this Collection" } }, "_embedded": { "fx:custom_fields": [...] }, "total_items": "5", "returned_items": 5, "limit": 20, "offset": 0 }
<?xml version="1.0" encoding="UTF-8"?> <resource href="..."> <link rel="self" href="..." title="This Collection"/> <link rel="first" href="...?offset=0" title="First Page of this Collection"/> <link rel="prev" href="...?offset=0" title="Previous Page of this Collection"/> <link rel="next" href="...?offset=0" title="Next Page of this Collection"/> <link rel="last" href="...?offset=0" title="Last Page of this Collection"/> <resource href="..." rel="https://api.foxycart.com/rels/custom_field"> ... </resource> <total_items>5</total_items> <returned_items>5</returned_items> <limit>20</limit> <offset>0</offset> </resource>
{ "properties": { "total_items": "5", "returned_items": 5, "limit": 20, "offset": 0 }, "entities": [...], "links": [ { "rel": [ "self" ], "href": "..." }, { "rel": [ "first" ], "href": "...?offset=0" }, { "rel": [ "prev" ], "href": "...?offset=0" }, { "rel": [ "next" ], "href": "...?offset=0" }, { "rel": [ "last" ], "href": "...?offset=0" } ], "actions": [ ] }
Embedded Resource: 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.