Happy Business Starts Here

Re: How to set a field to NULL via REST API

Daniel_L
Support SME

How to set a field to NULL via REST API

How do I set a field that has an existing value to NULL using Actions > Update call via REST API.  For example, an account has an existing Default Payment Method and now this needs to be set to Null.



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 ACCEPTED SOLUTION

Accepted Solutions
Daniel_L
Support SME

Re: How to set a field to NULL via REST API

 

You will need to use the fieldsToNull option to set the DefaultPaymentMethodId field to Null.

 

Please see our REST API Reference which pays reference to the fieldsToNull field within Actions > Update.

 

The following is a Request example using fieldsToNul:

 

 

POST   https://rest.zuora.com/v1/action/update


{
    "objects":[
        {
            "fieldsToNull":["DefaultPaymentMethodId"],
            "AccountNumber":"A00000036",
            "Id":"2c92c0f95a4085a8015a41f4012d183e"
        }
    ],
    "type":"Account"

}

 

 



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

2 REPLIES 2
Daniel_L
Support SME

Re: How to set a field to NULL via REST API

 

You will need to use the fieldsToNull option to set the DefaultPaymentMethodId field to Null.

 

Please see our REST API Reference which pays reference to the fieldsToNull field within Actions > Update.

 

The following is a Request example using fieldsToNul:

 

 

POST   https://rest.zuora.com/v1/action/update


{
    "objects":[
        {
            "fieldsToNull":["DefaultPaymentMethodId"],
            "AccountNumber":"A00000036",
            "Id":"2c92c0f95a4085a8015a41f4012d183e"
        }
    ],
    "type":"Account"

}

 

 



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

santhoshreddy
Newly Enrolled

Re: How to set a field to NULL via REST API

I am using this and it is not making it null. Does it really work?

I want to make the filed (ItemType__NS) to null, is there any other way which works

 

 

{
    "objects":[
        {
            "fieldsToNull":["ItemType__NS"],
            "Id":"2c92c0f84d658e8e014d6d4463667aa8"
        }
    ],
    "type":"ProductRatePlanCharge"

}