I Need to get DISCOUNT Details + Product Details So I can Show them in my Web Application and Appy DISCOUNT ID When Order Create E/P.
But I can get DISCOUNT Details but there are no Item details How can I get them?
This is my code implementation that I am trying to get data.
const catalogApi = this.client.catalogApi;
const allProducts = await catalogApi.listCatalog(
undefined,
"ITEM",
undefined,
undefined
);
const allProductList = await catalogApi.searchCatalogObjects({
//TODO: add this filter if not match the return value for currant list MODIFIER
objectTypes: ["DISCOUNT","PRICING_RULE"],
includeRelatedObjects: true,
includeDeletedObjects: false,
});
Example Object Result :-
{
"type": "DISCOUNT",
"id": "V4CTUH",
"updatedAt": "2023-11-02T20:52:53.781Z",
"version": "1698958373781",
"isDeleted": false,
"presentAtAllLocations": true,
"absentAtLocationIds": [
"L5K9GH0DWZV0P"
],
"discountData": {
"name": "COFFEE4MATES",
"discountType": "FIXED_PERCENTAGE",
"percentage": "100.0",
"pinRequired": false,
"modifyTaxBasis": "MODIFY_TAX_BASIS"
}
},
There is no related object Id or anything