# \[@wix/ecom\] Wix API returns empty custom fields in orders

**URL:** <https://forum.wixstudio.com/t/wix-ecom-wix-api-returns-empty-custom-fields-in-orders/63599>\
**Category:** Ask the community\
**Tags:** wix-ecom-v2, api, wix-headless, question, code\
**Created:** [October 16, 2024, 12:25pm UTC](https://forum.wixstudio.com/t/wix-ecom-wix-api-returns-empty-custom-fields-in-orders/63599 "2024-10-16T12:25:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohan\_Prasath\_K](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mohan_prasath_k/32/98360_2.png) [@Mohan\_Prasath\_K](https://forum.wixstudio.com/u/Mohan_Prasath_K)\
**Post date:** [October 16, 2024, 12:25pm UTC](https://forum.wixstudio.com/t/wix-ecom-wix-api-returns-empty-custom-fields-in-orders/63599/1 "2024-10-16T12:25:07Z")

</div>

**Question:**  
Wix API returns empty custom fields in orders , even though it has valid value.

**Product:**  
Wix Headless API  
@wix/ecom

**What are you trying to achieve:**  
I am trying to generate a report from my customer of his order, I have a pick up date, which is custom field.  
I added this field in checkout form, and I can see it in orders in wix dashboard.  
However when I fetch via wix-api, the value is missing and I get an empty array.

**What have you already tried:**  
Tried reading documentation and searched in forums, but could not find a solution.

**Additional information:**  
This is a code snippet.

import { orders } from “@wix/ecom”;  
import { ApiKeyStrategy, createClient } from “@wix/sdk”;  
import moment from “moment-timezone”;  
import type { NextApiRequest, NextApiResponse } from ‘next’;

const myWixClient = createClient({  
auth: ApiKeyStrategy({  
apiKey: process.env.WIX\_API\_KEY || ‘’,  
siteId: process.env.SITE\_ID || ‘’,  
accountId: process.env.ACCOUNT\_ID || ‘’,  
}),  
modules: {  
orders,  
},  
});

const ordersData = await myWixClient.orders.searchOrders({  
search: {  
filter: {  
$and: [  
{ createdDate: { $gte: formattedStartDate } },  
{ createdDate: { $lte: formattedEndDate } }  
]  
}  
},  
});

---

<div class="post-metadata">

**Author:** ![amandam](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amandam/32/79539_2.png) [@amandam](https://forum.wixstudio.com/u/amandam)\
**Post date:** [October 21, 2024, 6:44pm UTC](https://forum.wixstudio.com/t/wix-ecom-wix-api-returns-empty-custom-fields-in-orders/63599/2 "2024-10-21T18:44:52Z")

</div>

If you are still struggling with headless implementation we have a headless channel in our Discord community that may be a good place to ask.

> **[Join the Wix Studio Community Discord Server!](https://discord.com/invite/47gUT9KabP)**
>
> The official Discord server for Wix Studio professionals doing brilliant things together. | 9659 members
