Unable to create coupon using Fynd SDK

Getting Below error :

023-12-05T12:09:07.550+05:30 ERROR 1 --- [p-nio-80-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: java.lang.RuntimeException: com.sdk.common.model.FDKServerResponseError: HTTP responseCode: 400 responseBody :{"success":false,"errors":"'validation'"}] with root cause

com.sdk.common.model.FDKServerResponseError: HTTP responseCode: 400 responseBody :{"success":false,"errors":"'validation'"}
        at com.sdk.platform.cart.CartPlatformService$ApplicationClient.createCoupon(CartPlatformService.java:259) ~[fdk-client-java-1.3.6.jar!/:1.3.6]
        at com.sdk.platform.cart.CartPlatformService$ApplicationClient.createCoupon(CartPlatformService.java:244) ~[fdk-client-java-1.3.6.jar!/:1.3.6]
        at com.jio.campaign.service.CouponService.createCoupon(CouponService.java:48) ~[classes!/:1.0-SNAPSHOT]
        at com.jio.campaign.controller.CouponController.create(CouponController.java:26) ~[classes!/:1.0-SNAPSHOT]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
       
Coupon Add Request Body :

{
“dateMeta”: {
“modifiedOn”: “2023-12-05 12:27:32”,
“createdOn”: “2023-12-05 12:27:32”
},
“ownership”: {
“payableCategory”: “seller”,
“payableBy”: “”
},
“author”: {
“createdBy”: “CMS”,
“modifiedBy”: “CMS”
},
“state”: {
“isArchived”: false,
“isDisplay”: true,
“isPublic”: true
},
“restrictions”: {
“userType”: “registered”,
“priceRange”: {
“max”: -1,
“min”: -1
},
“platforms”: [
“web”,
“android”,
“ios”
],
“postOrder”: {
“cancellationAllowed”: false,
“returnAllowed”: false
},
“uses”: {
“maximum”: {
“total”: 10
}
}
},
“action”: {
“txnMode”: “coupon”
},
“tags”: [
“platform”
],
“rule”: [
{
“key”: 10000,
“value”: 9,
“max”: 1000
}
],
“displayMeta”: {
“title”: “CMS Coupon”,
“apply”: {
“title”: “Coupon applied successfully”
},
“subtitle”: “CMS Coupon”,
“description”: “CMS Coupon”
},
“code”: “TESTAPICOUPON100”,
“typeSlug”: “percentage_quantity_percentage”,
“identifiers”: {},
“validity”: {
“priority”: 0
},
“ruleDefinition”: {
“currencyCode”: “TESTAPICOUPON100”,
“autoApply”: false,
“type”: “bundle”,
“isExact”: true,
“applicableOn”: “quantity”,
“calculateOn”: “esp”,
“valueType”: “percentage”,
“scope”: [
“category_id”
]
}
}

@Shivendra_Singh The API is throwing validation error because the request payload which you’re passing is not in the correct format. For Example dateMeta, it should be passed as date_meta but you’re passing it as dateMeta.
Please use the given payload as reference :

{
    "type_slug": "percentage_quantity_percentage",
    "identifiers": {
        "user_id": [],
        "brand_id": [
            2094,
            3301
        ]
    },
    "rule_definition": {
        "scope": [
            "brand_id"
        ],
        "type": "percentage",
        "applicable_on": "quantity",
        "value_type": "percentage",
        "calculate_on": "esp",
        "is_exact": false,
        "auto_apply": false,
        "currency_code": "INR"
    },
    "rule": [
        {
            "key": 1,
            "value": 10,
            "min": 599,
            "max": 100
        }
    ],
    "restrictions": {
        "uses": {
            "remaining": {
                "user": -1,
                "app": -1,
                "total": -1
            },
            "maximum": {
                "user": -1,
                "app": -1,
                "total": -1
            }
        },
        "ordering_stores": [
            434
        ],
        "post_order": {
            "return_allowed": true,
            "cancellation_allowed": true
        },
        "platforms": [
            "web",
            "android",
            "ios"
        ],
        "price_range": {
            "min": -1,
            "max": -1
        },
        "payments": {
            "jiopp": {
                "codes": [],
                "uses": {
                    "max": -1,
                    "remaining": -1
                },
                "types": [],
                "networks": []
            }
        },
        "user_groups": [],
        "user_type": "guest"
    },
    "date_meta": {},
    "validity": {
        "priority": 0
    },
    "display_meta": {
        "title": "Testing the coupon",
        "subtitle": "nothing",
        "description": "",
        "apply": {
            "title": "Coupon applied successfully",
            "subtitle": ""
        },
        "remove": {
            "title": "",
            "subtitle": ""
        },
        "auto": {
            "title": "",
            "subtitle": ""
        }
    },
    "code": "test123456789",
    "ownership": {
        "payable_by": "",
        "payable_category": "seller"
    },
    "_schedule": {
        "cron": null,
        "start": "2024-01-05T07:37:09.827Z",
        "end": null,
        "duration": null
    },
    "state": {
        "is_public": true,
        "is_display": true,
        "is_archived": false,
        "is_domain_specific": ""
    },
    "validation": {
        "anonymous": true,
        "user_registered_after": null
    },
    "action": {
        "txn_mode": "coupon",
        "action_date": null
    },
    "tags": [
        "platform"
    ]
}