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

<script>
// Place Ecwid integration code here
// ...

// 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': 'order_comments'
};
</script>

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.

How it works

Learn how to save private information about storefront or a customer into an order.

  1. Modify Ecwid integration code to initialize the fields
  2. Set values for extra fields when customer visits a store
  3. Get saved info in order details in Ecwid REST API

Check out more details on how to do this in the docs below.