NAV

Order extra fields

Order extra fields allow you to save additional information into the order and get it via Ecwid REST API.

Add a new field to order comments at store checkout

// Init order fields 
ec.order = ec.order || {};
ec.order.extraFields = ec.order.extraFields || {};

// Add new text field to order comments section at checkout
ec.order.extraFields.how_you_found_us = {
    'title': 'How did you find us?',
    'type': 'text',
    'checkoutDisplaySection': 'payment_details'
};

Ecwid.refreshConfig();

Find your saved information in order details via REST API

{
    "total": 12.35,
    "orderNumber": 104,
    //...
    "extraFields": {
        "how_you_found_us": "I clicked an ad on Facebook."
    }
}

For example, if you need to save a cookie into an order or if you need to ask a customer a couple of questions at checkout – it’s totally possible with the order extra fields. Later it can be retrieved via the Ecwid REST API when getting order details or searching for orders.

Table of contents

We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.