Skip to main content

Deleting and archiving

DELETE does not mean the same thing on every resource, and the difference decides whether you can reuse an external key afterwards. Two consequences that surprise people:
  • You cannot delete an address a carrier points at. addressId and billingAddressId are restrict-on-delete. Clear the reference on the carrier first, then delete the address.
  • Deleting a company does not delete its addresses. Because the delete is soft, the cascade never fires — the address rows survive, still pointing at a company that no longer appears anywhere. Clean them up yourself if you care.
For customers, prefer the soft delete (PUT with deletedAt) over DELETE. It frees the external key exactly the same way, but it’s reversible and it doesn’t take the customer’s address history with it.