def METHOD_NAME(sender, instance, **kwargs):
    try:
        if not instance.is_invited or instance.payment_amount == 0:
            # Delete the invoice, because there should be no invoice for this registration
            services.delete_external_invoice(instance)
        else:
            # Create or update the invoice
            services.create_or_update_external_invoice(instance)
    except Administration.Error as e:
        send_sync_error(e, instance)
        logging.error("Moneybird synchronization error: %s", e)