Happy Business Starts Here

Highlighted
Advanced Tutor

How to delete uploaded usage file

I upload the usage file via rest api. I check the response and the file has been uploaded sucessfully.

Afterwards I check the import status (url from the response) and sometimes the status indicates the file has not been sucessfully imported.

 

Could be a timing problem or something else. When I look into the zuora system via Browser I recognize a huge problem. The import response is not reliable. Sometimes the file has been imported successfully (although the status response says otherwise) which leads to duplicate usage uploads. I send the file again and again and create multiple usages for the same invoice item. 

 

My preferred solution is to send an explicit "delete usage" request to make sure, the file is not processed.

 

1. How can I delete a single usage file with the rest api?

2. Every file has a unique ID. Can I list uploaded files to find duplicates with the rest api?

 

Tags (1)
4 REPLIES 4
Highlighted
Support SME

Re: How to delete uploaded usage file

 

Hiya,

 

I checked the reported scenario and you can only delete the usage records and not the file via REST API.

Details can be found in the REST Documentation as below:

 

https://www.zuora.com/developer/api-reference/#tag/Usage

 

However, in the UI, there is a provision to delete the file, please navigate as below:

 

Billing -> Usage -> Click on the filename

Here you have a delete button.

 

Also, regarding retreiving the duplicate file details, unfortunately there is no flag for duplicate files.

 

Please let me know in case of further concern.






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

Highlighted
Advanced Tutor

Re: How to delete uploaded usage file

I can't delete a single usage record. In order to do that I need to know the ID of the usage.

But the bulk upload of the csv file doesn't return the usage ids.

 

We added a custom ID Field to the CSV File (MAGICLINETRACKINGID). 

Can I access / delete the usages with the help of our trackingid?

 

 

I checked the documentation of the upload api and it says quote 

Of the five possible results displayed at that URL Pending, Processing, Completed, Canceled, and Failed) only a Completed status indicates that the import was successful. 

I check only for the completed status. How long does it take for the zuora api to reach the end state completed or failed? I could add a polling interval, e.g. for 30 seconds and check the status multiple times. But it needs to be a reliable solution for our fully automated job server. Is the file always processed synchronously?

Highlighted
Support SME

Re: How to delete uploaded usage file

Hi,

 

Could you please provide me the documentation of the upload api referred above.






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

Highlighted
Advanced Tutor

Re: How to delete uploaded usage file

https://github.com/zuora/codelibrary-java/blob/master/src/main/java/io/swagger/client/api/UsageApi.j...

 

The generated client doesn't support the file upload. But its documentation has more details, then the api reference.

I implemented it as documented here:

 

https://de.zuora.com/developer/api-reference/#operation/POST_Usage