Happy Business Starts Here

0 Kudos

deleting objects with child objects in single call

Currently to delete an Account, one must use the API to delete subscriptions, invoices, payments, amendments individually. This is a lot of calls and lot of steps to follow. THere should be a way to delete an account or subscription or any object together with all it's children. 




manual steps:

1) change invoices to draft

2) if payments, delete payments, processed payments can't be deleted

3) cancel draft invoiecs

4 delete cancelled invoices


new way: call delete() from API and this will delete all payments, amendments and invoice itself.


Ideally this should work for any object type. Account, subscription, invoice, etc


1 Comment
Zuora Engineering

There are 3 ways to delete account and its children.







curl -X DELETE -H "apiAccessKeyId: dummyUser" -H "apiSecretAccessKey: dummyPassword" -H "Content-Type: application/json" "https://rest.zuora.com/v1/object/account/{id}"


Both SOAP AND REST are synchronous API call. When the account has large number of children data, it may time out. but in the backend the deleting operation is still on going.



UI delete is async call. UI triggers the delete operation and returns. The operation runs in the backend. When you delete large account, it's recommended to delete from UI.


Please note, the delete operation is not cancellable. all data are deleted. Please make sure you want to delete account.