Skip to content

Checkout fields

Steps for

How it works

What happens to checkout field data

Customer fills in the field

On the Details step of the checkout
(this flows forward)

Saved with the order

Standard fields go to set places; custom fields are saved as order notes
(this flows forward)

Shown to you and the customer

In your platform's order admin and the customer's My Account
(this flows forward)

Used elsewhere

On invoices and packing slips, in automations, or sent to your ERP through the API
KindHow it's identifiedWhere the data goesUse it for
Standard fieldA fixed id that SparkLayer recognisesA structured place on the order, such as Shopify's own PO number field. You can search and filter by it, and use it in your theme and template editor.Customer references, purchase order (PO) numbers and requested shipping dates
Custom fieldA name you chooseThe order's notes (on Shopify, Additional details)Anything else, such as delivery instructions, a tax ID or a confirmation tick box

Checkout fields are separate from Additional Information, the single free-text box at checkout. See Cart and checkout.

What you can do without code

TaskWhereWho does it
Add the standard fieldsAdd field at Storefront,Options,Checkout (opens in your SparkLayer Dashboard in a new tab) (Core Script 4.7.0 or later)You
Add your own custom fieldAdd field at Storefront,Options,Checkout (opens in your SparkLayer Dashboard in a new tab)You
Add a file upload field, a validation rule (such as no weekend delivery dates) or any other optionYour Core Script, the SparkLayer code in your theme, with checkoutCustomElementsYour developer or agency

Turn on standard checkout fields

Standard fields need Core Script 4.7.0 or later: check Version for this store at Storefront,Widgets,Core script version (opens in your SparkLayer Dashboard in a new tab).

  1. Go to Storefront,Options (opens in your SparkLayer Dashboard in a new tab) and open Checkout.
  2. Next to Checkout fields, click Add field and choose a standard field. Set whether it's shown, optional or hidden.
  3. Repeat for each standard field you want.
  4. Click Save and publish. See Storefront options.
Core Script code for your developer

For more control, a developer can add standard fields to the Core Script by id. The id must match exactly, or SparkLayer won't recognise the field.

FieldField ID
Customer Referencecustomer-reference
PO Numberpo-number
Requested Shipping Dateshipping-requested-date
Core Script
checkoutCustomElements: [
  { id: "customer-reference" },
  { id: "shipping-requested-date" },
  { id: "po-number" },
],

Standard fields take the same attributes and onChange keys as custom fields (see Custom field settings). For example, to make the customer reference required:

Core Script
checkoutCustomElements: [
  {
    id: "customer-reference",
    attributes: {
      required: true,
    },
  },
],

Where standard fields appear in your orders

Shopify only

On Shopify, standard fields are saved here:

FieldWhere it's saved
PO NumberShopify's own PO number field on the order, shown as a PO number column in your orders and draft orders lists.
Requested Shipping DateA dedicated custom field on the order, shown as sparkShippingRequestedDate.
Customer ReferenceThe Shopify order notes field.

Your theme and template editor can use these fields, so you can show them on documents such as invoices. Customers see them on the order's Summary in My Account.

In the order and activity views, you can:

  • Search by Customer Reference
  • Search by PO Number
  • Filter by Requested Shipping Date, using a date range

Add a custom checkout field

A custom field is one you design, such as a delivery instructions box, a tax ID or a confirmation tick box. To add one without code:

  1. Go to Storefront,Options (opens in your SparkLayer Dashboard in a new tab) and open Checkout.
  2. Next to Checkout fields, click Add field and fill in the field's details.
  3. Click Save and publish.
  4. Check the Details step of the checkout on your store.

Shopify only

On Shopify, you can show a field only to customers with a particular tag: see B2B-only content.

For validation rules, grouped drop-down menus and every other option, your developer can add the field in the Core Script.

Where custom field data is saved

Custom field answers are saved to the order as notes.

WhereWhat you see
Shopify orderThe Notes card, under Additional details, beside SparkLayer's own details such as sparkCartId and sparkPaymentType. Shopify calls these custom attributes.
Customer's My AccountThe order's Additional Information, for example "Preferred Shipping Date: 2024-12-02".

Shopify only

On Shopify, custom attributes can also:

Some third-party invoicing apps can show Additional details too; check with the app's developer. To show answers on SparkLayer invoices, see Content Zones.

Let customers upload files at checkout

A file upload field lets B2B customers attach files to the order at checkout, such as a purchase order or order-specific details. It needs the Growth, Pro or Enterprise plan: to change plan, go to Plan card or see SparkLayer plans and pricing (opens in a new tab).

Your developer adds the field in the Core Script:

  1. Add the sample below to your Core Script, inside checkoutCustomElements.
  2. Change the settings in attributes to suit.
  3. Edit translations to change the text customers see.
Core Script code and settings for your developer
Core Script
checkoutCustomElements: [
	{
		translations: {
			en: {
				title: "File Upload",
				detail: "Files must not be larger than 10MB. You can upload between 1 and 4 files"
			},
		},
		name: "file-upload",
		attributes: {
			type: "file",
			required: false,   // Optional. Default: false
			minlength: 1,     // Optional. Default: 1
			maxlength: 4,     // Optional. Default: 20
			maxsize: '10MB',  // Optional. Default: 20MB, Must be a number followed by `B`, `KB` or `MB`
			fileextensions: [ // Optional. Default: ['txt', 'csv', 'pdf', 'json', 'png', 'jpeg', 'gif', 'webp', 'svg', 'psd', 'xls', 'xlsx', 'ods', 'fods', 'ppt', 'pptx', 'odp', 'fodp', 'doc', 'docx', 'odt', 'fodt']
			  'png',
			  'txt',
			  'pdf',
			  'xls'
			]
		}
	}
],
SettingWhat it does
requiredSet to true to make the customer upload a file. Default: false.
minlengthThe minimum number of files the customer must upload. For example, 1 means at least 1 file. Default: 1.
maxlengthThe maximum number of files the customer can upload. For example, 4 stops them uploading more than 4. Default: 20.
maxsizeThe largest file size allowed, as a number followed by B, KB or MB (for example, 10MB). The default and maximum is 20MB; you can set a lower limit but not a higher one.
fileextensionsThe file types customers can upload. By default, all of these are allowed: ['txt', 'csv', 'pdf', 'json', 'png', 'jpeg', 'gif', 'webp', 'svg', 'psd', 'xls', 'xlsx', 'ods', 'fods', 'ppt', 'pptx', 'odp', 'fodp', 'doc', 'docx', 'odt', 'fodt']
translationsThe text customers see: the field title and the detail helper text.

Customers then see a File Upload field on the Details step, and their files appear on the order in My Account, under Attachments.

What customers see

The field has a Choose file button and helper text, such as the size limit and number of files allowed. Chosen files are listed above the button, and customers can remove one before continuing.

Under Attachments, each file shows its File name and Assignment (Order-level for checkout uploads), with an Actions menu to download it.

Download uploaded files

There are 3 ways to get a file a customer uploaded:

WhoHow
The customerSigns in and downloads the attachment from the order.
A sales agentSigns in on the customer's behalf with sales agent ordering, opens the order and downloads the attachment.
The APIThe SparkLayer Files API links uploads to the order data, so they can go to a back-office system such as an ERP. For help, contact our support team.

Shopify only

On Shopify, the order lists uploads in Additional details under file-upload (or your field's name). These are file references (gid://sparklayer/File/...) that can't be opened from Shopify.

For other platforms, see the developer docs.

Let customers upload files on the product page

Line-item uploads let customers attach a file to a specific product, such as a logo or name customisation. This advanced setup needs a developer: see Let customers upload a file in the JavaScript SDK docs.

How product-level file uploads work once set up

Product page

One or more upload fields, each with its own label (such as Front Design) and a Choose file button
(this flows forward)

Cart

Each file is shown under the product line, for example Front Design: "logo.png"
(this flows forward)

My Account

The files appear on the order under Attachments, assigned to the product's SKU

You can combine product-level and checkout-level uploads, such as a logo per product plus a purchase order for the whole order. All files appear on the order in My Account.

Move to the standard fields

If your developer set up a customer reference or shipping date in the Core Script the older way, switch to the standard fields to get structured storage, search and filtering.

If your Core Script hasReplace it with
The Additional Information field with customerReferenceHidden and customerReferenceRequiredThe standard field { id: "customer-reference" }
A shipping date custom field with a name, such as my-shipping-requested-dateThe standard field { id: "shipping-requested-date" }
Before and after code for your developer

Customer reference. If you used the Additional Information field with the customerReferenceHidden and customerReferenceRequired display settings, like this:

Core Script
display: {
  customerReferenceHidden: false,
  customerReferenceRequired: true,
},

replace it with the standard field:

Core Script
checkoutCustomElements: [
  {
    id: "customer-reference",
    attributes: {
      required: true,
    },
  },
],

Requested shipping date. If you added a shipping date as a custom field with a name, like this:

Core Script
checkoutCustomElements: [
  { name: "my-shipping-requested-date" },
],

switch it to the standard id:

Core Script
checkoutCustomElements: [
  { id: "shipping-requested-date" },
],

The id must be shipping-requested-date. A custom field's name can be anything you choose; using the standard id is what turns on the structured storage, search and filtering.

Add a custom field in the Core Script (for developers)

The Core Script gives every option for a custom field, such as validation rules and grouped drop-down menus. It's a theme code change, so pass this section to your developer or agency if you don't edit your theme.

  1. Add a checkoutCustomElements array to your Core Script (or add to it if it's already there).
  2. Add one object per field, with a name, translations (the text customers see) and attributes (the field type and validation). See Custom field settings.
  3. Save your theme and check the Details step of the checkout.

This example adds a required delivery date field:

Core Script
checkoutCustomElements: [
  {
    name: "delivery-date",
    translations: {
      en: {
        title: "Delivery Date",
        detail:  "Delivery unavailable on weekends."
      }
    },
    attributes: {
      required: true,
      type: "date"
    }
  },
],

One array can hold several fields. This example shows most of the supported field types:

Example fields

Copy one of these into your Core Script, or send it to your developer, and adjust it to suit.

Reference

Custom field settings

Settings for fields added in the Core Script, for your developer:

KeyWhat it does
nameThe name of the field. It's shown in your eCommerce platform but not to customers. Required (standard fields use id instead).
translationsAn object of customer-facing text, keyed by two-letter language code (ISO 639-1 (opens in a new tab)). Required.
titleInside translations: the text shown in bold above the field. Required.
detailInside translations: small helper text shown under the field, for example to explain what to enter.
attributesHTML attributes for the field, which set its type and validation: max, maxlength, min, minlength, name, pattern, placeholder, required (default false), disabled (default false), step and type (default text). Some attributes only apply to certain types; see the MDN input attributes reference (opens in a new tab).
optionsFor select fields: the drop-down options, optionally in named groups.
onChangeA function that validates the value and returns a message key from translations if it's invalid.

To change the default look of the fields, see Frontend integration.

Supported field types

Field typeWhat the customer enters
textFree text
selectA choice from a drop-down menu
numberA number
dateA date, DD/MM/YYYY
timeA time, 00:00
weekA week (for example, week 4)
monthA month of the year (for example, 12)
datetime-localA date and time, DD/MM/YYYY 00:00
checkboxA tick box (allows multiple selections)
telA phone number
emailAn email address
urlA website URL
fileA file attachment (Growth, Pro and Enterprise plans)

FAQs

Was this page helpful?

Last updated