0

Cannot remove a CAT receivable through the API

Dennis Rosenbaum 5 years ago in API 0

Hi,

I'm trying to remove all the receivables through the API.
This is the process that I use:

  1. Retrieve the Receivable ID's through a Macro (for my quote, it shows '461')
    #set($receivableIds = $utils.createNewArrayList())
    #foreach($quote in $list)#*
        *##foreach($task in $quote.tasks)#*
            *##foreach($receivable in $quote.getTaskFinance($task).getAllReceivables())#*
            *##set($temp = $receivableIds.add($receivable.id))#*
            *##end#*
        *##end
    #end
    #foreach($receivableId in $receivableIds)$receivableId,#end
  2. Verify this result by checking the quote itself:
    onmouseover="xhp.task.receivables.open(461, true, false);"
  3. Execute the API call
    DELETE /api/v2/quotes/4YTI6WVKGRE2ZLXJ5KG3GGAJ24/finance/receivables/461 HTTP/1.1
  4. This fails with this message:
    {"status":400,"errorMessage":"No receivable with id: 461 for quote with id: 4759","detailedMessage":null}

When I add a regular receivable, it does work. Only with the CAT receivables it doesn't work.

Is it possible to be fixed? Or am I doing something wrong?

Kind regards,
Dennis Rosenbaum