Happy Business Starts Here

Highlighted
Support SME

Update Default Payment Method Using SOAP API

Using the SOAP API, what is the correct way to change the default account payment method when the new one uses a different payment gateway from the previous?



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

3 REPLIES 3
Support SME

Re: Update Default Payment Method Using SOAP API

(1) Use an update() (Account) call to change the gateway that the Account is switching to, at the same time, set Auto-Pay to 'False' (if currently set to 'True') and set null value for Default Payment Method.

 

Here's a sample SOAP API request:

 

<ns1:update>
	<ns1:zObjects xsi:type="ns2:Account">
		<ns2:fieldsToNull>DefaultPaymentMethodId</ns2:fieldsToNull>
		<ns2:Id>****************</ns2:Id>
		<ns2:AutoPay>false</ns2:AutoPay>
		<ns2:PaymentGateway>Test Gateway</ns2:PaymentGateway>
	</ns1:zObjects>
</ns1:update>

 

(2) Use a create() call to create the desired Payment Method for this Account.

 

(3) Use an update() (Account) call to set Auto-pay to 'True' (if required) and select the new Default Payment Method.

 

* Please note that the order of the fields is important so fieldsToNull must be placed above Id.



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

Student

Re: Update Default Payment Method Using SOAP API

I'm unable to set a "null" payment method id for the default payment method, using the CRUD APIs. Is there a way for the Zuora API to remove a default payment method, when there is no renewable subscription (only a one time payment) and when the account has AutoPay set to "no"?

Guru

Re: Update Default Payment Method Using SOAP API

I mark the payment methods Closed

 

 For (Zuora.zObject zo:zobjs){
            Zuora.zObject pm = new Zuora.zObject('PaymentMethod');
            pm.setValue('PaymentMethodStatus', 'Closed');
            pm.setValue('Id',zo.getValue('Id'));
            updateObjects.add(pm);
        }

Then turn off autopay - and we put all of these account in 1 billing batch that is not used for billing.

        Zuora.zObject account = new Zuora.zObject('Account');
        account.setValue('Id', zAccountId);

        //Remove from auto pay if selected
        account.setValue('AutoPay', false);

        //Update Billing Batch to Batch 1
        account.setValue('Batch', 'Batch1')
Maggie Longshore