Deleting Records


There are no delete endpoints. To delete a record, send it to its Add/Update endpoint with deleted set to true. Hyfin keeps the record but hides it, and stops using it from then on.

Delete an invoice
			
{
  "_id": "64f1c2a9e4b0a1b2c3d4e5f6",
  "deleted": true
}


		

After a record is deleted

  • The Get endpoints no longer return it. Asking for it by id returns Unable to find record.
  • Sending the same externalId again creates a new record, because the deleted one is no longer matched. An accepted subscription is the exception, described below.

Invoices

  • An invoice that has a payment taken through Hyfin cannot be deleted. The request fails with Invoice has been paid and cannot be deactivated.
  • Once an invoice is deleted, Hyfin stops texting, emailing and reminding the customer about it, and it cannot be sent again.

Customers

  • Hyfin stops texting and emailing a deleted customer, unless you give an email address on the invoice itself.
  • Deleting a customer does not delete or cancel their open invoices. Links already sent still work, so the customer can still pay.
  • Delete or cancel the open invoices too if they should no longer be paid.

Subscriptions

A deleted subscription stops charging. Scheduled automatic payments for it are skipped. Once the customer has accepted a subscription, deleting it cancels it instead. It stays visible with status closed, and sending its externalId again fails with Cannot reactivate a subscription that has been closed.

See Errors for the messages these rules return.