Mapping Issue with _custom_json attribute

Hi team, while calling the cart.addAddress api, I am having the invalid mapping type issue. The issue goes as soon as I comment my _custom_json attribute. There is not much info about _custom_json attribute . The requirement is to add some custom attributes to address. I suppose I should be able to add to any valid json string. attaching code and error for reference. Also I have doubt whether the same issue exists for other apis too.


this.$apiSDK.cart.addAddress({
            body : {
                _custom_json : JSON.stringify({i : {am : { a : 'custom json'}}}),
                address : 'Splendor Tower, Gurgaon',
                area_code : '385001',
                city : 'Gurgaon',
                country : 'India',
                is_active : true,
                is_default_address : true, 
                phone : '8708186152',
                state : 'Haryana',
            }
        }).then((resp) => {
            console.log('addAddress', resp);
        })
app.0b56d67aaf4b35d6247f.js:48 Uncaught (in promise) FDKServerResponseError: Not a valid mapping type.
    at app.0b56d67aaf4b35d6247f.js:48:304436
    at async e.exports.addAddress (app.0b56d67aaf4b35d6247f.js:83:23424)

Hi @aakash140799_1

Can you try with omitting the parameter _custom_json in body part of addAddress fdk method?

Perhaps now the _custom_json parameter is not supported for addAddress fdk method. Before it is supported _custom_json parameter.

You can refer to the documentation link provided here: Add address to an account | Fynd Partners Help Center

1 Like

Hi Sir, It works after omitting _custom_json. Is there any alternative to this attribute?

Hi @aakash140799_1

_custom_json requires json value, so remove JSON.stringify for value being passed then try.

Still same error, I have tried with object/json string/random string. It gives same error.

Hi @aakash140799_1

Please share FDK version that you are using and payload and error for the same. It seems that below payload is working for latest FDK version.

{
    _custom_json : {i : {am : { a : 'custom json'}}},
    address : 'Splendor Tower, Gurgaon',
    area_code : '385001',
    city : 'Gurgaon',
    country : 'India',
    is_active : true,
    is_default_address : true, 
    phone : '8708186152',
    state : 'Haryana'
}

Thanks Sir, It is working now.