Skip to main content

Bulk Delete

To delete multiple records in FIYGE, we will use the endpoint GET /delete_selected

For example, to bulk delete invoices we will call the below request

Request​

POST v2.crm.immigrate.fiyge.com/accounting/invoices/delete_selected.json?id[]=442&id[]=441&is_confirm=1&select_all_records=0

Params​

  • id[]=442&id[]=441 to specify the id of the records to be deleted (decoded for demonstration purpose)
  • is_confirm=1 to confirm deleting the records
  • select_all_records=0 to apply changes on only selected records
  • override=1 (Optional) to override warning of dependent records. A warning will be returned if the record to be deleted is linked with other records, e.g. a invoice is linked to a credit memo

Error handling​

In addition to the possible errors in Error Handling Section, bulk deletion could result in "dependent records" error.

Dependent records​

When a record is linked to other records, for example when a credit memo is attached to an invoice, deleting the invoice is going to return an error like the following, which is intended to alert the user of his/her actions. Adding the optional parameter override=1 will allow user to delete the record without any errors.

{
"errors": [
"Could not delete invoices[252] as it has dependent \"credit_memos\"",
"Record [252] could not be deleted"
],
"message": [],
"inherit_views": 1,
"alias": "invoices",
"singular": "invoice",
"model": "invoices",
"controllerClass": "\\module\\accounting\\controller\\invoices",
"modelClass": "\\module\\accounting\\model\\invoices",
"notEmptyField": [],
"organization_name": null,
"organization_id": "001",
"user_id": "0001",
"user_fullname": "User name",
"data": []
}